PSoC 5LP USBUART CDC Problem

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

cross mob
Anonymous
Not applicable

Hello community,

   

I use the PSoC 5LP and I would like to send datas from the PSoC to my PC.

   

The example project "HID Mouse" works fine.
This is my code:

   

#include <project.h>
#include <USBUART_cdc.h>

   

static int8 Data[3] = {0x01, 0x02, 0x03};
uint8 length = 3, x;

   

void main()
{
    CyGlobalIntEnable; /* Enable global interrupts. */
    USBUART_Start(0, USBUART_5V_OPERATION);
    while(USBUART_GetConfiguration()==0)
    {}
    USBUART_CDC_Init();
    
   for (;;)

   

    {
       while(USBUART_CDCIsReady()==0)
       {
       }
       USBUART_PutData((uint8*) Data, (uint8) length);
    }
}

   

 

   

I also have already installed the windows driver.
On my device manager I can see the new COM-Port.

   

The problem:
I cannot see anythink on a terminal program.

   

Whats wrong?

0 Likes
1 Solution
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

You won't see the data as it is not ASCII it is non printable characters the 01hex = start of heading ,02hex is start of text and 03hex is end of text.  change the data to 31 hec ,32 hex and 33 hex and see it it displays on your terminal program. 

View solution in original post

0 Likes
3 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

You won't see the data as it is not ASCII it is non printable characters the 01hex = start of heading ,02hex is start of text and 03hex is end of text.  change the data to 31 hec ,32 hex and 33 hex and see it it displays on your terminal program. 

0 Likes
Anonymous
Not applicable

Perfect, thanks!

0 Likes
Anonymous
Not applicable

FYI: some terminal programs (RealTerm, for example) allow you to display hex values rather than ASCII.  In case you wanted to verify that the correct non-ASCII data is being sent.