Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I am using CY8CKIT-050. I built a simple UART project. However I have encountered two hurdles:
1) UART Tx is sending garbage. In the attached project I am trying to parse a known string, and send the parts of it to the remote com. Problem is when the string gets parsed the known good data strings UTCtime, Latitude, Longitude(verified in debug mode) is sending out as garbage which appears to be even longer in size then the declared size of the char arrays. There is no problem with sending out known static string, such as original sting or some other constant value.
2) The values of the char variable LatitudeNS changes as the sorting progresses (from 'N' right after correct sorting to '1' right before the transmitting out). The weird part it changes in the place of the code that has nothing to do with it. Right after change 1 is identified by red color in the debugger.
What does the red color of variable in debug mode identify? Recently changed/accessed value?
Couple of things about these two things - I realize that they must be very basic and I am missing something very trivial or there is an explanation to this that makes complete sense. However I am failing to grasp it. Please help.
UART_PutString() handles C-Language strings which always have to be NULL-terminated. If your string lacks the terminator, the function will start to send chars out until it finds a \0 by accident.
PutString() and PutChar() are "blocking" functions which means that they check for themselves for a free buffer and wait until all their characters are stored (but not yet transmitted. So there is no need for you to wait for an empty FIFO.