I'm confident its user error, but I seem to be unable to program my
PIC16F628A (it's my first foray into the world of PICs, been working with
arm M4's). All I'm trying to do is turn on LED outputs, but I this doesn't
seem to be working. I'm trying to use the internal 4MHz oscillator, all the
port A and B pins (so everything except for VDD and VSS) are connected to a
10K resistor and LED. This is all done on a breadboard, so it's possible
there is an error in the wiring, but it appears to be correct.

I'm using a PicKIT 2 to program it (and it can correctly auto identify the
device as a PIC16F628A) and believes it successfully flashes the device.
This leads to me to believe I have a good chip, and the ICSP worked out
correctly.

I'm attempting to build with SDCC, with the appended code, but I don't get
any thing on any of the output pins, it simply sits there after power on.
Are there any obvious errors here?

Thanks for your time.


/////////////////////////////////////////////////////////////////////////////////////
#include "pic16f628a.h"

unsigned int __at 0x2007 __CONFIG = _INTOSC_OSC_NOCLKOUT &      // Internal
oscillator
                                _WDT_OFF        &       // No Watchdog
                                _LVP_OFF        &       // No Low-Volt
Program.
                                _DATA_CP_OFF    &       // No Code Protect
                                _PWRTE_ON;

static unsigned char count;

void main(void) {
        CMCON |= 0x07;  // Disable comparators.  NEEDED FOR NORMAL PORTA
        TRISB = 0x00;   // Set port B as all outputs
        TRISA = 0x00;   // Set port A as all outputs
        PORTA = 0xFF;
        PORTB = 0xFF;

        while(1) {}
}
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to