Solved the oscillator problem.
"DEFINE osc 16" doesnt work
"DEFINE OSC 16" does work
Serial still not working but i have a feeling thats something simple.
Ive tried 2 things from Mister-e's calculator
Code:
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 25 ' 9600 Baud @ 16MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Code:
RCSTA = $90 ' Enable serial port & continuous receive
TXSTA = $20 ' Enable transmit, BRGH = 0
SPBRG = 25 ' 9600 Baud @ 16MHz, 0.16%
I have also added this code
Code:
loop:
if pir1.5=1 then
newbyte=rcreg
high portb.0
pause 100
low portb.0
endif
goto loop
when any serial data comes in that should make the LED flash but its not doing. I think this might be to do with the circuit itself (currently thinking outside of the box. Using breadboard instead). Ill try and solve that tomoz. For now though i really am going to bed :P Ill let you know how it goes tomoz
Bookmarks