You are here

Uart with big buffer and internal interrrupts | Cypress Semiconductor

Uart with big buffer and internal interrrupts

Summary: 2 Replies, Latest post by odissey1 on 18 Apr 2016 11:43 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
arek's picture
9 posts

I'm trying to write a function to handle the a GSM modem using AT commands and Uart (SCB mode).
Uart on SCB has RX and TX buffer 128 bytes each.
Unfortunately, my function not working properly.
This function reads 8-10 bytes instead of 128.
Sometimes also lost bytes.

There is no in PSoC Creator decent example  how to use a uart with big buffers.

Please can you help me and show you how to write this function.




user_1377889's picture
9249 posts

You should avoid interfering with the internal UART interrupt. Instead poll in main()

        while( SCB_SpiUartGetRxBufferSize())
            buf_RX[i++] = SCB_SpiUartReadRxData();

look for a delimiter in the message received as \n or \r, then process the message and reset i



user_342122993's picture
527 posts

Attached is UART_RX project, which uses circular buffer to receive incoming strings an separate them into tokens. You can adjust Rx buffer size to your needs.

Log in to post new comments.