Interesting UART problem
Posted: Mon Oct 03, 2016 1:05 pm
I am developing a device with CC3200 MCU running WiPy port of MP. My intention was to use both UART interfaces:
- UART0 for logs through serial console and REPL
- UART1 for communication with another device through MAX232
I am experiencing very strange behaviour:
When receiving data through UART1 sometimes these data are mixed with serial console output. In some cases I can clearly see several characters from serial console output to make their way into data read from UART1 interface. I was thinking that there must be some interference problem in my HW despite the fact I did not find and short circuits - RX/TX pins of UART0 and UART1 seems to be isolated from each other. I decided not to init UART0 and not to call dupterm() at all.
I connected to the console output/REPL through Telnet and I observed similar behaviour - console output characters making their way into received data of UART1.
My question is: is there any place in SW stack of MP and underlying layers (or in the HW) where these data streams could mix? Maybe there is some shared buffer?
Notes:
- I am using CC3200 module similar to this one (not the original WiPy):
https://www.aliexpress.com/store/produc ... 76696.html
- I am reading data from UART1 by checking machine.UART.any() and performing machine.UART.read() when necessary within the main loop (while based) - I did not try how it would behave in case of reading through an ISR yet
- UART0 for logs through serial console and REPL
- UART1 for communication with another device through MAX232
I am experiencing very strange behaviour:
When receiving data through UART1 sometimes these data are mixed with serial console output. In some cases I can clearly see several characters from serial console output to make their way into data read from UART1 interface. I was thinking that there must be some interference problem in my HW despite the fact I did not find and short circuits - RX/TX pins of UART0 and UART1 seems to be isolated from each other. I decided not to init UART0 and not to call dupterm() at all.
I connected to the console output/REPL through Telnet and I observed similar behaviour - console output characters making their way into received data of UART1.
My question is: is there any place in SW stack of MP and underlying layers (or in the HW) where these data streams could mix? Maybe there is some shared buffer?
Notes:
- I am using CC3200 module similar to this one (not the original WiPy):
https://www.aliexpress.com/store/produc ... 76696.html
- I am reading data from UART1 by checking machine.UART.any() and performing machine.UART.read() when necessary within the main loop (while based) - I did not try how it would behave in case of reading through an ISR yet