Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

UART.read strange output

Hello.
I am seeing a strange behavior when i use UART.read, maybe I am missing something here but I do not get the result that I am supposed to get.

Here is the simple code I use now during debug for reading the data that is sent to UART.

UART.setDispatcher(uartNo, function(uartNo, ud) {
  let ra = UART.readAvail(uartNo);
  if ( ra > 0 ) { // read buffer not empty
    data = UART.read(uartNo);
    print("Received UART data:", data);
  }
}, null);

And here is the output from the print.
Received UART data: \xa0\x9f\x81\x81
Received UART data: \xd0
Received UART data: \xb3
Received UART data: \x82
Received UART data: \xa7
Received UART data: \xaa
Received UART data: \x86

But the thing is that the output is not what is actually being sent from this output it looks like the response from the UART is this
0xA0 0x9F 0x81 0x81 0xD0 0xB3 0x82 0xA7 0xAA 0x86

But when i connect my logic Analyser on the same pin just to verify the data then I see the correct data.

What do you think about this?

Comments

Sign In or Register to comment.