Since, thankfully, I'm about to go out and enjoy myself for the rest of the day (at the Bedfordshire School of Falconry in case anyone wanted to know), and I don't want to see you struggle with your 16F876A, I will tell you that you should add...
Code:
CMCON=%00000111 ' Disable Comparators
CVRCON=%00000000 ' Disable Reference Module
Insert these two lines after the OPTION_REG.7=0 statement in the Initialise Processor Section. Actually, thinking about it, the Olympic Timer doesn't use PORTA, so technically you don't need the above two lines to make it work.
But you will need to add an 'A' to the end of the processor designation in each of the eight lines in the PIC Defines section...
Code:
@ DEVICE pic16F876A, XT_OSC ' System Clock Options
@ DEVICE pic16F876A, WDT_ON ' Watchdog Timer
@ DEVICE pic16F876A, PWRT_ON ' Power-On Timer
@ DEVICE pic16F876A, BOD_ON ' Brown-Out Detect
@ DEVICE pic16F876A, LVP_OFF ' Low-Voltage Programming
@ DEVICE pic16F876A, CPD_OFF ' Data Memory Code Protect
@ DEVICE pic16F876A, PROTECT_OFF ' Program Code Protection
@ DEVICE pic16F876A, WRT_OFF ' Flash Memory Word Enable
It will compile with the command line (assuming you've called your file olympic.bas)...
PBPW -p16P876A olympic -v
If it doesn't compile, check your program. The -v will cause the compiler to point to your problem.
If it compiles but doesn't work, then you've done something wrong... check all your connections, Xtal/Resonator, MCLR pin, Hardware, Supply voltages. Not all LCD's like to have the Contrast pin connected to Vss... if yours is one of those, ensure you have a suitable Contrast connection (see LCDOUT in PICBasic Manual for an example schematic).
Have a nice day.
Bookmarks