USART only returns first 2 bytes from incoming 8 bytes
Posted: Sat Oct 29, 2011 5:37 am
Hi Everyone, this has got me stuck.
I send an "ATDL" string to an Xbee from the TX1 of my 18F87J50 USART and that causes the Xbee to return 8 bytes of data + <CR> to my RX1.
I can see the 8 bytes enter RX1 on my scope but my USART.readbyte loop runs out of chars after the getting only first two chars of the 8.
Im sending the incoming chars out on USART2 TX2 to a dumb terminal so I can see whats happening.
USART.Write("ATDL",13)
DelayMS(200)
while USART.DataAvailableTimeout(10)
c = USART.ReadByte()
USART2.Write(c)
Wend
I send an "ATDL" string to an Xbee from the TX1 of my 18F87J50 USART and that causes the Xbee to return 8 bytes of data + <CR> to my RX1.
I can see the 8 bytes enter RX1 on my scope but my USART.readbyte loop runs out of chars after the getting only first two chars of the 8.
Im sending the incoming chars out on USART2 TX2 to a dumb terminal so I can see whats happening.
USART.Write("ATDL",13)
DelayMS(200)
while USART.DataAvailableTimeout(10)
c = USART.ReadByte()
USART2.Write(c)
Wend