You are here

UART Implementation | Cypress Semiconductor

UART Implementation

Summary: 2 Replies, Latest post by H L on 15 Mar 2013 05:58 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
rockym's picture
24 posts

 Hi ,

I want to use UART user module.

I want to send 4 bytes of data from PC to PSOC. 

PSOC when receive should send 2 bytes of data back.

I will use a 4 byte array for rx buffer and 2 byte array for tx buffer.

When 4 bytes data is received interrupt should occur.

How can i implement it 




user_1377889's picture
9296 posts

Frankly : you cannot.

An Interrupt can be generated at the receive of EACH character since interrupts in PSoC 1 are related to hardware.

I would suggest to have the number of incoming characters counted (after retrieving and storing them) and when your treshold (or a pre-defined sequence) is reached you set a flag (a global variable) that you inspect in your main-loop and, if set react accordingly (or just inspect the count).


Happy coding


user_460349's picture
1362 posts

 I normally use a ring buffer, all data receive would be queue up in the ring buffer and the main loop inspect the head and tail pointer. 

if you know the total number of bytes is a fix number, then just do the decoding when the number of bytes received, and if that is correct then send the bytes out.

Log in to post new comments.