Software will stay in the waiting state.
Hserin will not. Also you can use the timout parameter and after a predefined time (in ms) it will jump to a label if something is wrong.
Ioannis
Software will stay in the waiting state.
Hserin will not. Also you can use the timout parameter and after a predefined time (in ms) it will jump to a label if something is wrong.
Ioannis
Thanks Ioannis,
My setup is as follows:
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
INTCON = 0
DEFINE HSER_CLROERR 1
HSERIN 1000,nodata,[datareceived]
If the RX input pin has held low it would not break out from waiting.
It doesn't make sense why it's not jumping out of the wait state aas the HSERIN is reading the buffer as opposed to serin is bit banging.
Anyway if you state it does break out regardless of the pin state, I'll double check my code again tomorrow morning.
Rob.
The plus in using the hardware USART instead of the software Serin/Serin2 is that it does not hang there if there is a problem in the state since the hardware reads based on an internal clock. If data is at 0 or at 1, then the data read is just nonsense.
More, the ardware USART does have 2 bytes buffer and Interrupt support.
Your code would jump to the label nodata after 1 sec, if there is no communication on the Rx line. What nodata does, I do not know. Please show your complete code.
Ioannis
Bookmarks