Reply
Posts: 33
Registered: ‎02-24-2016

Two EFM8BB3 UART0 communication abnormal

Hello everyone!
Recently l got a problem about two EFM8BB3 communicate through UART0 with 2400bts(accurate value: 2407bts). When I get the power of these two MCU on simultaneously, the communication is normal, both transmition and reception.
But the weird thing is, when I change the sequence of power-on, one MCU first, the other next, the reception units of both MCU become abnormal. I have checked the real signal of the RX by oscilloscope, the signal is completely same as the other's TX…
Hope you guys can help me, thank you so much!
Posts: 144
Registered: ‎07-12-2016

Re: Two EFM8BB3 UART0 communication abnormal

hi Airut,

 

Did you check the Rx/Tx data with some COM port debug tool when this symptom appear ? And attached your project will help to troubleshoot the issue.

 

Thanks

Cheng

Posts: 8,079
Registered: ‎08-13-2003

Re: Two EFM8BB3 UART0 communication abnormal

when ... the reception units of both MCU become abnormal

'forever' or just for the first message?

erik
Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

If I do not cut the power, this situation seems to be permanent…But the next time I get these two MCU power on simu
Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

If I do not cut the power, this situation seems to be permanent…
But the next time I get these two MCU power on synchronously, everything is normal again.
Posts: 8,079
Registered: ‎08-13-2003

Re: Two EFM8BB3 UART0 communication abnormal

the obvious background is that a character is sent during the receivers power up and, probably. partially received.. This will lead to the receiver getting bad data.  Is it possible that your code for the receiver get its knickers in a knot when bad data is received?

erik
Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

I can't get it...My code for the receiver only check if the coming character is beginning of a series of the needed data. If bad code is received, the receiver still works and will wait for the right code coming.
Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

But you may point out the main reason that caused the problem - the receiver has already begun receiving before it powers up.
Posts: 8,079
Registered: ‎08-13-2003

Re: Two EFM8BB3 UART0 communication abnormal

the receiver has already begun receiving before it powers up.

huh? do you mean bits are coming to the receiver before it powers up.

erik
Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

Sorry…I mean the signal has came to the RX port before the receiver MCU powers up.
Posts: 8,079
Registered: ‎08-13-2003

Re: Two EFM8BB3 UART0 communication abnormal

I do not know what you are doing, but it is not uncommon to have a pin to pin connection between the two and then "do not send till "sense pin is low".

 

HOWEVER with proper code this is not needed

1) either side must easily recover from bad data

2) either a handshake or a lost message is OK

erik
Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

Recover from bad data?
Do you mean the bad data will make SBUF overflow?But I only process 8bits and put this one character in other array in the UART0 interrupt, and also reset RI in the interrupt.
So would you please give a simple example of how to recover from bad data?
Posts: 8,079
Registered: ‎08-13-2003

Re: Two EFM8BB3 UART0 communication abnormal

Do you mean the bad data will make SBUF overflow?But I only process 8bits and put this one character in other array in the UART0 interrupt, and also reset RI in the interrupt.

what happens in the array if you get a lot of characteres before valid data

 

So would you please give a simple example of how to recover from bad data?

'recovery' simply is to get rid of the bad and recognize the start of the good, but how do you handle that the first record from the sender is lost?

 

it is standard that the receiving device, after seeing end of message return a code OK/error

erik
Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

Thank you, I have written code about recognizing the start of the right data that helps me get rid of bad data...
I have supervised the receiver on the PC and it always got bad data even the RX signal is totally same as the sender's TX.
The data lost problem...uhh...I tested these two MCU under the situation that the sender is continually sending the same data, about per 2 second. So data lost is not the reason of the problem I got.
Now I am wondering whether some hardware problems happened in the RX.
<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,154
Registered: ‎04-27-2004

Re: Two EFM8BB3 UART0 communication abnormal


The data lost problem...uhh...I tested these two MCU under the situation that the sender is continually sending the same data, about per 2 second. So data lost is not the reason of the problem I got.
Now I am wondering whether some hardware problems happened in the RX.

You need care doing any continual sending tests, especially duplex.

Do you use 2 Stop bits on TX side ?

That allows some tolerance in sustained data rates, otherwise you can have 'data squeeze' effects, even at what seem like low baud rates.

Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

@jmg I only use 1 stop bit on both TX sides.
I need these two MCU communicate continually even in the real situation they may update data to each other per 2s, so I did the continual sending test.
Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

Solved, hardware problem!
Posts: 324
Registered: ‎09-22-2009

Re: Two EFM8BB3 UART0 communication abnormal

What was the hardware problem?

Posts: 33
Registered: ‎02-24-2016

Re: Two EFM8BB3 UART0 communication abnormal

Uh…Kinda of unpredictable and hard to explain…Well, the RX port was set to 'emitter input' in hardware design at that time…when first power on, if the MCU hasn't been initialized, the signal coming to the RX may bring the 3.3V directly to the MCU and caused some shutting down internal.
Highlighted
Posts: 8,079
Registered: ‎08-13-2003

Re: Two EFM8BB3 UART0 communication abnormal

if the MCU hasn't been initialized, the signal coming to the RX may bring the 3.3V directly to the MCU and caused some shutting down internal.

 

methinks if the MCU hasn't been powered up,  do you have 1k from reset to VDD to hold the mcu in reset when this parasitic power is applied

erik