You are here

UART Buffer Issue | Cypress Semiconductor

UART Buffer Issue

Summary: 5 Replies, Latest post by Gautam Das on 17 Dec 2012 02:41 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
PeterHouse's picture
User
2 posts

I have configured the UART for Buffered operation with a buffer size of 128 running at 57.6Kbps.  Using UART_PutArray I have issues sending more than a few characters.

At 5 characters, they are all sent correctly, and 6 breaks it.  It looks as if the problem is related to interrupts.  As long as the UART_PutChar routine puts the character directly into the PSOC UART send data register the character are sent.  If the UART_PutChar routine places the character into the buffer then the buffer continues to fill and none of the characters are sent.  The UART_TxBufferWrite increments correctly and the UART_TxBuffer Read stays at zero.

The TX - On FIFO Empty interrupt is turned on and it seems like the interrupt is just not firing.

Any Ideas?

 

hli
user_78878863's picture
User
2759 posts

Just out of the blue: did you enable global interrupts?

Maybe you can post your project here (create a workspace bundle), so we can have a look at it.

PeterHouse's picture
User
2 posts

Enable Global Interrupts.  Such a simple concept. 

I've been writing Assembler and some C programs for 35 years and am once again humbled.

Thank you for your quick response.

Peter

user_1377889's picture
User
10803 posts

I extracted all that initialization stuff into a separate routine named InitializeHardware(). To be honest, more than once i forgot to call it in main().

 

You are not alone in the dark

Bob

hli
user_78878863's picture
User
2759 posts

Sometimes this crystal ball thingie on my desk really works

What also helps is that I amde this error more than once - this helps learning... Now I started to look, everytime I start a project, through the whole generated/provided code (especially main) and either delete the line or add a comment why I leave it in. This helps me preventing such mistakes.

dasg's picture
Cypress Employee
730 posts

Hi PeterHouse,

 

Also, if you are using Interrupt on Rx or Tx, please ensure that the Interrupt is configured to "Level" triggered instead of "Rising" or "Derived". Since UART is a Datapath based component, the interrupt on FIFO's status will remain high till is is cleared. Configuring it as "rising" might result in missing of bytes.

Log in to post new comments.