Jump to content
43oh

Erratic characters with Serial library using G2553


Recommended Posts

Hi,

 

I think this is more related to the MSP430G2553 than to Energia but I want your opinion.

I am a beginner with all of this so don't be surprised if my questions are stupids.

 

For my project (a beacon generator with an RTC clock) I was using TimerSerial for debugging.

I had no problem at all with it, always had good data coming from the LaunchPad.

 

Then I decided to switch to Serial (the hardware UART) since TimerSerial was generating some delays and possibly making the RTC drift.

Using a simple code (just a clock) with short strings sent every second, no problem.

However, using Serial with my beacon code that generate a lot of text for debugging, the display was totally erratic.

It seems that the hardware UART has a really small buffer and if I send too much data too often it get corrupted and then all the following strings are corrupted.

 

Can someone confirm me this or is it something in my code ?

It is not a big deal indeed since I can switch back to TimerSerial and this display is only for debug, but I would like to understand...

 

Thanks for your help.

Regards,

Yannick.

Link to post
Share on other sites

Hi friends,

 

I could post the code but it is rather long and since the serial things are used only for debugging there is a lot of #IFDEF and it will not be really easy to read.

I will try to post the interesting things anyhow.

However, this is the weekend and I have kids at home until tuesday because it is Trung Thu (Moon day).

 

Robert, if you'd like to try to compile the code I can send it to you via a private message.

 

Thanks for your help!

Yan.

Link to post
Share on other sites

Hi,

 

Well, this is just to keep the community informed.

We (in fact mainly Robert) are investigating the problem as it may be a bug in the Serial library.

This could be related to a SRAM exhaustion.

 

If you experience the same kind of anomaly, please report...

 

Regards,

Yannick.

Link to post
Share on other sites
  • 2 weeks later...

Hi,

 

The problem was all mine. I did a little rework of my code and saved a few bytes of SRAM.

Now the program is running ok with Serial lib for hardware communications.

It seems likely that the memory was exhausted and in some cases Serial could have been using too much SRAM for its buffers and getting corrupted characters.

 

I will soon publish the code in my blog.

 

Regards,

Yan.

---

http://xv4y.radioclub.asia/

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...