S12Z UART Reset

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

S12Z UART Reset

1,096 Views
manishsangram
Contributor IV

Hello,

We are using S12ZVCM Chip and we use the onboard UART module for communication with PC which interactively controls the device.

Very often the communication between the PC terminal application and the device gets corrupted. Despite restarting the PC application which is a simple Serial terminal application the data flowing in from the device continues to be corrupt. Corrupt here does not mean complete junk, but rather strange things like a single line is broken into 2 lines.

Unless the device is restarted this problem does not solve itself even if the communication is broken and restarted by restarting the application or by disconnecting the wire and reconnecting. 

We want to be able to 'reset' the UART without restarting the MCU so that we can restore the communication to it's valid state.

0 Kudos
5 Replies

801 Views
RadekS
NXP Employee
NXP Employee

Hi Manish,

I guess, that you mean S12ZVMC. Correct?

 

Could you please specify which channel on evaluation board you use for such communication (on-board CP2102 UART to USB interface or OSBDM interface)? Or you use your own board?

 

The output data stream is generated by some specific software like FreeMaster, or by your own application code?

 

Is it possible to check communication at UART level by some logic analyzer or oscilloscope?

In that case, we can focus on SCI module and software or on UART to USB interface.

 

Is this “broken into 2 lines” always in the same place in generated single line?

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

801 Views
manishsangram
Contributor IV

Hello Radek,

1) Yes, I meant S12ZVMC. Sorry for the typo!

2) We are using our own board, we are not using any evaluation board from NXP.

3) The output data stream is generated by our application, however we are using the Term+Inhr components of PE from Codewarrior, so essentially it is not our code, we are only calling the functions.

4) Unfortunately we cannot check using oscilloscope or logic analyser because this problem only happens in the field and not in the lab environment. Typically this might get triggered because of some event such as unshielded wires (running from device to PC) is shaken or something. The problem is that even after the wire is corrected the data does not correct itself, unless the device is power cycled. Even restarting the PC software does not correct the problem, so it's not on the PC side.

 

5) I am not sure if this is the lines are broken in exactly the same place but it could be. They seem to be approximately of similar length to the eye visually

6) The reason we would like to reset SCI is so that when the product is in the field and remains turned on for a long period of time and then if we need to communicate but find that the output is corrupted, at least by reset-ing SCI we could bring the system back into communicable state.

7) We are connecting TX, RX, GND via wires to a UART-USB 'dongle'. Reseting the dongle (remove and reinsert), restarting the PC terminal software etc. does not solve the problem. We have to reboot the device.

0 Kudos

801 Views
RadekS
NXP Employee
NXP Employee

Hi Manish,

Thank you very much for these details.

Since SCI still communicate, I suppose that SCI reset will not solve your issue.

The SCI module is quite simple module and it does not work with messages, but rather with simple bytes/characters.

The SCI module may be disabled by clearing SCICR2_TE (Transmitter Enable Bit) and SCICR2_RE (Receiver Enable Bit) bits.

 

Per your description, I guess that problem might be rather in the software.

Could you please share your project for short review, or create and share some simple project with SCI driver configuration the same as in your case and some similar code for input/output stream?

 

If you don’t want to send you project share as public. Please create a ticket.

https://community.nxp.com/docs/DOC-329745

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

801 Views
manishsangram
Contributor IV

Hello Radek,

I understand your point.

I will re evaluate the conditions in terms of restarting the PC software etc. The one possibility we had considered was that some characters may be switching the terminal software into a different terminal type, however we had ruled it out due to all the evidence listed in the previous message of mine.

None the less I will recheck because as you rightly said the SCI is only sending bytes and (I assume) it has no setting which will change it's behaviour in a way that it either changes the byte placed in the register or sends extra bytes (eg. CRLF) etc. 

0 Kudos

791 Views
sodiptaberutu
Contributor II

Hi, has someone solved this issue. I am working with S12ZVCA. I send data from PC to the controller over SCI. Very often the communication gets corrupted. The workaroud what I did is only the hardware reset and plug-out and -in the USB cable. Your help would be highly appreciated.

 

Kind Regards

Berutu

0 Kudos