Jump to content
lethaixuong

How to check error when using UART?

Recommended Posts

Hi,

How can I check error when MCU receives wrong byte through using UART?

 

I use Computer (C#) to transmit data to msp430g2553.

Are there any solutions or example to check if RX and TX are not the same?

 

Thanks a lot.

Share this post


Link to post
Share on other sites

You could get the MSP430 to echo back what it's received (or a checksum byte). It depends what the rest of your application is doing.

 

I dont want it to echo all income data back because I will send another data back.

 

I want to know how the parity works in this situation.

Share this post


Link to post
Share on other sites

If your question is how to enable parity and check it, I don't think there's anything in energia to make this happen (or the documentation is outdated)

If you don't need all 8 bits, you could use the msb as a parity bit and implement it in software.

Share this post


Link to post
Share on other sites

If your question is how to enable parity and check it, I don't think there's anything in energia to make this happen (or the documentation is outdated)

If you don't need all 8 bits, you could use the msb as a parity bit and implement it in software.

So how to enable parity checking in ENERGIA?

 

In the other word, I want to make CRC checking while TX and RX.

Anyone has done this before?

Share this post


Link to post
Share on other sites

I just checked the serial code in energia, you can't do it directly.

 

I suppose you could play with the registers after doing a serial.begin to enable the parity bit but I don't know if this would conflict with the interrupt routines.

Share this post


Link to post
Share on other sites

I just checked the serial code in energia, you can't do it directly.

 

I suppose you could play with the registers after doing a serial.begin to enable the parity bit but I don't know if this would conflict with the interrupt routines.

 

Try this way:

Computer transmits another byte named CRC.

On MCU, it will generate a CRC to check whether it matches with CRC code from Computer.

 

But I don't know where to find CRC function in energia.

 

I need CRC 8 Function.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...