PSoC 4200 UART loses characters

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
DoLo_351801
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

I have Psoc cy8ckit-042 connected with 2 SCB Uart ports. One to the PC and the other to a SIM7600A GSM module. Programming and debug for the cy8ckit is via the onboard usb port.

P4.0  and P4.1 connected to the SIM7600. P0.4 and P0.5 connected to the PC via a Silicon Labs CP210x USB to UART Bridge.

I have tried multiple communication programs but Putty works as well as others. I can enter all the AT commands to the sim 7600 from putty and they work fine. But I cannot get the psoc to send commands to the sim 7600 without losing quite a bit of the message. I have tried turning the echo on and off. No difference. I’ve tried delays, no difference.

I’m using an interrupt to initiate a simple AT command to the SIM7600. When the interrupt is initiated, It prints to the PC uart (Putty) and it works fine, but I print to the sim7600 and it loses many of the characters.

A similar setup works fine using Arduino. I have tried many scenarios to get this to work on the PSOC but it does not cooperate.

I am using an interrupt handler for each UART for receiving. The basic program came from your CE224406_PSoC4_UART.pdf.

I have attached an archive of the project. You may ignore the functions that are not being used.

Any suggestions?

Thank-you

1 Solution

Thank-you. I downloaded "two_uart_200425", set the pins, adjusted the board

rate and it runs perfectly.

The project is similar to mine except it collects an entire line where I

was responding to each character. Should be interesting.

I will add an interrupt handler to respond with a message to the GSM module

based on a pin going high.

I will let you know how it works.

Thanks again

Doug

On Thu, Dec 31, 2020 at 8:56 PM BiBi_1928986 <community-manager@cypress.com>

View solution in original post

4 Replies
BiBi_1928986
Level 7
Level 7
First comment on blog 500 replies posted 250 replies posted

Hello.

You might want to read this discussion.  Similar project, 2 UARTs, CY8C4245 on KIT-049 (same PSoC as KIT-042), GSM module.

UART RX INTERRUPT PROGRAM FOR CY8CKIT 49

It starts off to get UARTs working using same app note CE224406, eventually talks with GSM module.

Good luck with our project.

0 Likes

Thank-you. I downloaded "two_uart_200425", set the pins, adjusted the board

rate and it runs perfectly.

The project is similar to mine except it collects an entire line where I

was responding to each character. Should be interesting.

I will add an interrupt handler to respond with a message to the GSM module

based on a pin going high.

I will let you know how it works.

Thanks again

Doug

On Thu, Dec 31, 2020 at 8:56 PM BiBi_1928986 <community-manager@cypress.com>

Hi Doug.

Great news!  A good way to start off the new year.

Bill

lock attach
Attachments are accessible only for community members.
DoLo_351801
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

I have 2 UARTs working. I can type a simple command like AT or ATE1 on the pc, it goes to the psoc via uartCMD which sends it to the GSM modem via uartGSM. I get a response "OK" from the UART_GSM which shows up on the PC via the UART_CMD. I can even send a set of commands which result in a text message being sent to my phone. Therefore the GSM is working, the 2 uarts are working.

 
Under program control, I can send simple commands also. I execute this by putting GSM commands in an interrupt routine  ISR_BILGEx1 attached to P3_1.
 
The problem arises when I send, under program control, several commands. It used to stop at 8 characters so I tried to increase the size of the Tx buffer of the uart_GSM which I did, and it helps. In fact, I increase the buffer size to 64 I can then send 64 characters but get stuck every time in the routine UART_GSM_SpiUartWriteTxData(). When the buffer overflows it assigns   "locHead = 0u; ". The next call to UART_GSM_SpiUartWriteTxData() gets stuck on "while (locHead == UART_GSM_txBufferTail)" and never leaves. I think the buffer tail is supposed to get up dated but never does.  I don't know how the buffer wraps around.
Maybe I don't have the uart of the interrupts set up correctly. It is hard for me to believe the cypress SW is at fault but maybe. More likely I haven't done something right. 
 
I do have an oscope but haven't used it on the project since the uarts seem to be working.
 
In my last letter, I might have said rx when I meant tx. It is the UART_GSM tx buffer that overflows and causes a problem.
 
You can see that I have tried many different things in interrupt routine ISR_BILGEx1.
 
Please explain how the tx buffer wraps around especially when it gets stuck in the  UART_GSM_SpiUartWriteTxData() routine. Also, am I initializing the uarts and interrupts correctly?
I have been stuck here for a week. 
Please help if you can. Thanks
Doug
0 Likes