- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You connected your isr_Rx to the UART tx_interrupt signal and not to the rx_interrupt.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome, Martin.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome, Martin.
Dana.