PSoC CY8CKIT-049-42xx Serial Communication

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.
Anonymous
Not applicable

Hello people:

   

I am Martin Ortuño from Mexico, I'm new in this PSoC Community.

   

Well... righ now I have problems with my recent acquisition, the PSoC CY8CKIT-049-42xx,  I've been trying some tutorials here and in other communities, in this moments I'm trying to probe the UART Communication by sending a char from a Serial Monitor ( 232Analyzer)  in my computer and then sending a char from the PSoC Prototyping kit to the Computer. I am using the UART  v2.30 from the Creator 3.1, a digital output for a LED, and my bootloadable module.

   

Then I set the pin for the serial communication and for the LED in the board. Finally I Build the Project, then write the following code:

   

#include <project.h>

   

char datoRecibido;

   

CY_ISR(InteruptRx)

   

{

   

    datoRecibido = UART_GetChar();

   

}

   

int main()

   

{

   

    CyGlobalIntEnable;

   

    UART_Start();

   

    isrRx_StartEx(InteruptRx);

   

    

   

    for(;;)

   

    {

   

        if(datoRecibido == '1')

   

        {

   

            LED_Write(1);

   

            UART_PutChar('H');

   

        }

   

        if(datoRecibido == '0')

   

        {

   

            LED_Write(0);

   

        }

   

    }

   

}

   

This code is downloaded to the PSoC just fine; however, when I try to put a "1" from  the 232Analyzer, the PSoC doesn't  send the message back.

   

I will appreciate all your help.

   

Thanks.

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

Welcome to the forum!

   

It is always easier to find reasons for non-working programs when we can have a look at *ALL* of your settings. So can you please post your complete project? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

We are currently at Creator 3.2 SP1 version, I would suggest you to update to latest using the Cypress update manager

   

Keep in mind that the signal levels of the PSoC are 3.3V while RS232 has +-12V levels which might destroy the chip when not using a level-shifter.

   

 

   

Bob

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

If using USB to power the board then PSOC signal levels are 5V. You need

   

a translator, like MAX232, to generate RS232 levels for PC, and to convert

   

PC RS232 levels back to 5V for 3.3 if using external lower V supply.

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi:

   

Thank you for replying, I'm uploading the complete project, so you can take look and help me.

   

Thank you so much

   

Martin Ortuño

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

You connected your isr_Rx to the UART tx_interrupt signal and not to the rx_interrupt.

   

 

   

Bob

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

You should declare this -

   

 

   

char datoRecibido;

   

 

   

as this

   

 

   

char volatile datoRecibido;

   

 

   

http://www.barrgroup.com/Embedded-Systems/How-To/C-Volatile-Keyword    Volatile

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Hi:

   

I made the change to the code in PSoC creator, and  then I wired the pins 0.4 and 0.5 to the Rx and Tx pins from the integrated PSoC USB Single Controller, and It works just fine...

   

Thank you for replying

   

Martín

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

You are always welcome, Martin.

   

 

   

Bob

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

You are always welcome, Martin.

   

 

   

Dana.

0 Likes