Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 1 > UART Communication

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



UART Communication
Moderator:
ARVI

Post Reply
Follow this topic



UART Communication

dkt posted on 05 Jan 2012 11:17 PM PST

1 Forum Post

 Hello,

 

I am using two UARTs in my system.One UART is for transmission and one UART is reception in duplex mode.

 

Here is a part of my Program

for(;;)

    {

        /* Place your application code here. */

//Wait for command

recv_byte=0;

UART_1_WriteTxData(0x0d);UART_1_WriteTxData(0x0a);

UART_1_PutString("Company Name.......");

         CyDelay(20);UART_1_WriteTxData(0x0d);CyDelay(20);UART_1_WriteTxData(0x0a);

CyDelay(20);UART_1_WriteTxData(0x0d);CyDelay(20);UART_1_WriteTxData(0x0a);

UART_1_PutString("auoto Zero  => Z");

          CyDelay(20);UART_1_WriteTxData(0x0d);CyDelay(20);UART_1_WriteTxData(0x0a);

UART_1_PutString("Measure     => M");

       CyDelay(20);UART_1_WriteTxData(0x0d);CyDelay(20);UART_1_WriteTxData(0x0a);

UART_1_PutString("Setup       => S");

        CyDelay(20);UART_1_WriteTxData(0x0d);CyDelay(20);UART_1_WriteTxData(0x0a);CyDelay(20);

UART_1_PutString("display oN  => N");

         CyDelay(20);UART_1_WriteTxData(0x0d);CyDelay(20);UART_1_WriteTxData(0x0a);CyDelay(20);

UART_1_PutString("display oFf => F");

         CyDelay(20);UART_1_WriteTxData(0x0d);CyDelay(20);UART_1_WriteTxData(0x0a);CyDelay(20);

UART_1_PutString("display Test=> T");

         CyDelay(20);UART_1_WriteTxData(0x0d);CyDelay(20);UART_1_WriteTxData(0x0a);CyDelay(20);

CyDelay(20);

.

.

.

.

.

so on.............and I am displaying all these datas through serial port in Hyperterminal in a PC

the problem that now I am facing is,there is only one or two lines is displaying or transmitting.After that the execution of the program is in a Pause state.

 

Can anyone please tell what is the reason for this problem ?

 




Re: UART Communication

Bob Marlowe posted on 05 Jan 2012 01:49 AM PST
Top Contributor
1768 Forum Posts

Would you mind to zip and post your complete project here, so we can have a look at all possibilities that cause your problem?

If you "Clean" your project before zipping it becomes smaller, there is a 2MB limit for uploads afaik.

Bob

 



Re: UART Communication

Bob Marlowe posted on 05 Jan 2012 02:36 AM PST
Top Contributor
1768 Forum Posts

At (very) first sight I can see, that you use the WriteTxData() API without checking the transmitter status. This will resullt in errorneous transmission of data..

What are your Delays for? Waiting until the data is transmitted? It will go better checking the status.

Use the PutChar() API instead, which will block, if the UART is busy or the transmit-buffer / FiFo is full.

The PutString() API already blocks, so there's no need to wait for it.

 

Bob

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20