Blink Programme for 16F876
My first project.
PicBasic Pro + Microcode Studio Plus v2.1.0.8 + Epic Plus Programmer + Prototype Board + XT 4Mhz
Tried first setup with C508 and BLINK.BAS programme no problem.
Selected different processor and successfully loaded programme into F876.
Can turn outputs ON at any pin position, but when i use the PAUSE instruction and any time setting within the programme nothing runs at all.
What am doing wrong?
16F876 PicBasic Pro Program Fault Corrected For Blink
<thanks to all for any advice>
After a long hair pulling session, figured out the 16F876 starts with the A/D running. I wanted digital out Pin 22 (RB1). This is turned off by command 'ADCON1=7' line.
Working code below to save someone else fustration:
' Ricky V
' 28 March 2005
' Blink Program
' MCU PIC16F876
' Rev 56,098,345
DEFINE OSC 4
ADCON1=7 'disable analogue to digital converter
TRISB = 0 'set all pins on Port B to outputs
LED VAR PORTB.1 'Sets which PIN the LED is on, Pin 22 +5V
loop:
High LED ' Turn on LED connected to PORTB.1 as Set in VAR LED
Pause 500 ' Delay for .5 seconds
Low LED ' Turn off LED connected to PORTB.1 as Set in VAR LED
Pause 500 ' Delay for .5 seconds
Goto loop ' Go back to loop and blink LED forever
End
=-=-=-=-=-=-=-=-==-=-==-=--=-=-=-=-=-=-==-=-=-=-=-==-
Same Code for blink 16F876A and "not working"
I used your exact code (which I know works just from looking at it) and I get this error "Code Programming error at 0000" - any suggestions, help?
-------------------------------
DEFINE OSC 4
TRISB = 0 'set all pins on Port B to outputs
LED VAR PORTB.1 'Sets which PIN the LED is on, Pin 22 +5V
loop:
High LED ' Turn on LED connected to PORTB.1 as Set in VAR LED
Pause 500 ' Delay for .5 seconds
Low LED ' Turn off LED connected to PORTB.1 as Set in VAR LED
Pause 500 ' Delay for .5 seconds
Goto loop ' Go back to loop and blink LED forever
End
------------------------------