Trouble with most basic BLINK on PIC 16F819
Hi folks
I'm having an impossible time getting anything with this PIC 16F819 chip (http://www.microchip.com/wwwproducts...=en010227)...I can't get the most basic program outputting a blinking LED:
Code:
'OSCCON = %01100100
'OSCCON = %01100110
OSCCON = $60 'set int osc to 4mhz
TRISA = %00000000 'set RA0 to output
ADCON1 = 2
Main:
High PORTA.0 ' Turn on LED connected to PORTB.0
Pause 1000 ' Delay for .5 seconds
Low PORTA.0 ' Turn off LED connected to PORTB.0
Pause 1000 ' Delay for .5 seconds
Goto main ' Go back to loop and blink LED forever
End
I've checked, double-checked, triple-checked the settings and tried a whole variety of things. I'm compiling with "INTRC" set as oscillator. I've got power going in on the fifth pin on the right side (Vdd, a.k.a. pin 14), and going to ground on the fifth pin on the left side (Vss a.k.a. pin 5). I've got a 100 Kohm resistor on the fourth pin on the left going to power. I've got my 220 ohm resistor w/led (both of which I've tested to make sure they function in the most basic circuit) oriented properly on the second pin down on the left side (which as I understand it is PORTA.0 per pin diagram on datasheet, a.k.a. pin '17').
Programming seems to work fine; I'm using the melabs U2 programmer. The programming software compiles fine with positive message all along the way, and I can see the U2 responding (via green-red-green led) as I do so. All the configurations options you see above (OSCCON, TRISA, ADCON1 settings) have been at one point removed, set to something else, etc. etc. etc. in all possible variations I could think of. Pointless!
I'm completely stumped. I can't get a freaking led to blink. I've been working on this for hours! I've reviewed a lot of the forum too, but apologize if I missed something obvious...
Any help would be greatly appreciated.
Thank you!!!
Best,
Dave