Hi Groston,
Let me post your code here first.
Code:
'****************************************************************
OSCCON = $60 ' set the internal clock to 4 MHz
define OSC 4 ' set osc to 4 MHz
TRISB.0 = 0 ' Set RB0 to output
' Initialize USART
define HSER_TXSTA 24h ' Enable transmit and asynchronous mode
define HSER_RCSTA 90h ' Enable serial port and continuous receive
define HSER_BAUD 9600 ' Set baud rate to 9600
recv var byte
cntr var word
recv = 0
cntr = 0
ADC_loop:
if recv = 0 then
hserout ["message ", dec cntr, 13]
else
hserout ["Other", 13]
endif
if cntr = 255 then
cntr = 0
else
cntr = cntr + 1
endif
PORTB.0 = 0
pause 1000 ' 1 sec delay
PORTB.0 = 1
pause 1000 ' 1 sec delay
hserin 1, missed, [recv]
goto ADC_loop
missed:
recv = 0
goto ADC_loop
What was your idea in the red part?
Could you give details as to understand what you wanted to do there? Currently, as it is now, it can not work.
--------------------------
Bookmarks