Send data with USBUART and interrpt

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

cross mob
Anonymous
Not applicable

Hi,

   

I'm trying to send data from SRAM to the PC with USBUART and an interrupt but the PC tell me that the device is unknown. I'm using the interrupt with the nqr output of the DMA tha save the data from the Digital Filter Module to the SRAM. How can I solve this problem?

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

There is an example project for PSoC5 and USBUART. Your access to the component is a bit different and I would suggest you to get that example working.

   

Care for enabling interrupts before you start the USBUART.

   

Declare your variable "adc" as "volatile" because it is changed in an interrupt handler!

   

Your data contains binary data only. Consider when sending to PC to convert to ASCII using sprintf().

   

You may save the device descriptor from the example project to a file and load that file into your TIA project.

   

 

   

Bob

View solution in original post

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

Welcome in the forum, ruben!
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

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

This is the project

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

Something has gone wrong with your workspace bundle, the archive does not contain all the files needed. Please correct and try again. An archive is usually several 100kB

   

 

   

Bob

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

Sorry

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

There is an example project for PSoC5 and USBUART. Your access to the component is a bit different and I would suggest you to get that example working.

   

Care for enabling interrupts before you start the USBUART.

   

Declare your variable "adc" as "volatile" because it is changed in an interrupt handler!

   

Your data contains binary data only. Consider when sending to PC to convert to ASCII using sprintf().

   

You may save the device descriptor from the example project to a file and load that file into your TIA project.

   

 

   

Bob

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

device is unknown....
This is what happens when USBUART_Start (0, USBUART_3V_OPERATION);
I change to 5 volt USBUART_Start (0, USBUART_5V_OPERATION);
And again, it seems there is a problem sending 64 bytes - should send a zero-length packet track, but I'm not sure.

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

Thank you, I have solved the problem with USB communication but I can't send the data properly. It must send data between 0-3.3V,

   

I couldn't send anything to the filter  I put this line since I couldn't send anything. Now it send some data but is wrong.

   

This is the new project. I changed something.

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

You get a very large number. To begin with, increase the length of the variable str
char8 str[64];