UART First Steps

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

cross mob
Anonymous
Not applicable

Good Morning, How i do my first communication UART to PC?, I need read 4 bytes, and the pc send me these in a buffer.

0 Likes
1 Solution
Anonymous
Not applicable

what clock divitions are you using in the program? You need a Clock input near 76800 to generate 9600

View solution in original post

0 Likes
9 Replies
Anonymous
Not applicable

hello saulo, you can look for the datasheet in PSoC designer you found functions and a example. 

Regards

0 Likes
Anonymous
Not applicable

I was trying to use the UART, configure the UART Clock to 9615 but when I want to read LED lights that never was "0" port

   

 

   

 

   

 

   

 

   

 

   

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

   

char CRX;  

   

BYTE Status;

   

 

   

void main(void)

   

{

   

UART_CmdReset();                      // Inicializando el buffer cmd y el UART

   

//E2PROM_Start();

   

PRT0DR = 0x00;

   

    //RX8_IntCntl(RX8_ENABLE_RX_INT);     // Enable RX interrupts

   

UART_Start(UART_PARITY_NONE);

   

M8C_EnableGInt ; // Uncomment this line to enable Global Interrupts

   

 

   

  while (TRUE)

   

{

   

//while(!RX8_bReadRxStatus()){;;}

   

//PRT0DR = 0x80;

   

CRX = UART_cGetChar();

   

if (CRX == '7'){PRT0DR = 0x80;}

   

         }

   

}

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

To connect an UART to your PC you will need a level-shifter on the PSoC side to get a +- 12V signal as required for RS232. When you are using a Cypress Development Kit there will be a driver on the board already.

   

When having problems like yours best will always be to upload the complete projeczt here. Use the "Archive"-function of Designer and upload the resulting program using ie (chrome still does not work correctly)

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

These might help -

   

 

   

    

   

         

   

http://www.cypress.com/?id=4&rID=33763

   

 

   

      http://www.planetpsoc.com/psoc1-kb-digital/20-baud-rate-and-clock-for-uart.html

   

 

   

      http://www.planetpsoc.com/psoc1-articles-digital/75-clock-accuracy-requirement-for-psoc-uart.html

   

 

   

 

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Sorry, i used a Bluetooth module, i have configured mi port 2 with Tx and Rx, before worked in PIC and mi Software its already and test in other projects, but is my firs time en PSoC and this code doesnt work.

0 Likes
Anonymous
Not applicable

have you checked your inputs clocks from the uart module? wich is your baudrate?

0 Likes
Anonymous
Not applicable

 Ok, the UART´s baudrate i belivie is a 9600 but i´ll check my module.

0 Likes
Anonymous
Not applicable

what clock divitions are you using in the program? You need a Clock input near 76800 to generate 9600

0 Likes
Anonymous
Not applicable

 oooooo.. ok i had no idea it was x 8, (Y), already running thanks.

0 Likes