K66 UART problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K66 UART problem

947 Views
biafra
Senior Contributor I

Hi everyone,

I'va already posted this problem in MCUXpresso Software and Tools section(Going crazy with UART (witch hunt)), but maybe this a better section to post.

I'm using a custom board with MK66F2M0 device, MCUXpresso 10.1.1, SDK 2.3.0 and UART FreeRTOS driver: the UART is connected to a GSM modem.

I've made a test with an oscilloscope, recording all the signals. The three images show what I found. The packet is the byte 0x01 repeated 144 times received from a GSM modem connected to the UART. The waves are the RX signal, the TX signal, the CTS signal and the RTS signal respectively. The UART is configured with RX FIFO enabled with a watermark of 1.

Start.PNG

This image shows the packet start: at the end of the stop bit of the first byte, the RTS signal goes high because the RXFIFO watermark is configured to 1 byte: the interrupt routine handle the RDRF flag, it reads the D register so the RTS signal goes low. At the end of every byte there is the same behaviour: after the stop bit there is the start bit of the subsequent character

 

Error.PNG

This image shows the error: the first RTS rise is at the end of the stop bit, then there is the start bit of another character. The strange thing is that the second RST rise is not at the end of the stop bit, but at the end of the first data bit of the subsequent character. From this point forward, all the charcters are received as 0x40, as if the first bit of data were actually the start bit.

 

End.PNG

This image shows the packet end: the last character is received as 0xC0.

 

I don't know how it can be generated: all the previous characters are received correctly and the waveforms are ever the same; I don't know why suddenly the RTS signal goes hig in the wrong place.

 

What esle can I verify?

 

Many thanks

Biafra

0 Replies