Try removing one of the "=" from each "IF" in your receiver program.
Try removing one of the "=" from each "IF" in your receiver program.
Keith
www.diyha.co.uk
www.kat5.tv
my bet is more about possibility of a buffer overflow.
Try this one for the transmitter
what about your crystal speed? Config fuses? Schematic?Code:Set transmit register to transmitter enabled DEFINE HSER_TXSTA 20h ' Set baud rate DEFINE HSER_BAUD 2400 cmcon = 7 Main: If (PORTA.1 = 0) then hserout ["1"] while PORTA.1=0 : Wend : pause 500 endif if (PORTA.1 = 1) then hserout ["2"] while PORTA.1=1 : wend : pause 500 endif goto main end
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
To answer your question directly, I have done a lot of serial projects on breadboards and never had an issue.
It sounds like you only want to send a character on the state change of the switch. Use a bit variable such as current_state for the last known state.Originally Posted by mister_e
This way, you won't hang the program up waiting for the switch to change.
Read_switch:
if (PORTA.1= current_state) then goto main ; No change goto main program
hserout [PORTA.1 + $30] ; Make the switch value the ASCII equivelent and send it.
current_state = PORTA.1 ; Current_state = switch value
goto main ; How neat is that?!?
for sure i need to sleep!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks