Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Simple Digital Communication with PC

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Simple Digital Communication with PC
Moderator:
ANCY

Post Reply
Follow this topic



Simple Digital Communication with PC

Quick posted on 15 Apr 2013 9:23 PM PST
Member
2 Forum Posts

 Hello, I am reading a large amount of analog data with my PSoC 5. I would like to save this data and view it on my PC.

I am collecting 40,000 samples per second. (1 byte per sample)

What would be the easiest way for me to transfer this data to a PC? I was thinking I should use the USBUART module, but it is kind of complex and I wanted to make sure this was really the best solution before pursuing it further.

Thanks,

Grant




Re: Simple Digital Communication with PC

Quick posted on 16 Apr 2013 10:01 PM PST
Member
2 Forum Posts

 Actually, it looks like it will be closer to 200k samples per second at 1 byte per sample. So the data connection will need to support 200 KBps or 800 Kbps. Not sure if that changes anything.



Re: Simple Digital Communication with PC

mike.hersh posted on 16 Apr 2013 10:02 PM PST
Top Contributor
21 Forum Posts

 Please see this video first:

www.youtube.com/watch



Re: Simple Digital Communication with PC

gbmhunter posted on 16 Apr 2013 10:47 PM PST
Top Contributor
23 Forum Posts

800kbps is pushing the limits of UART, which is one of the most common embedded-to-computer comm protocols. Although they do support 921600 baud, aka 921.6kpbs, I havn't had much luck running the UART at this high speed, and get corrupted data. You also have to consider start/stop bits and other overhead.

 

Maybe try your luck with an SPI interface. The SPI component in PSoC Creator can support your required baud rate, so all you need to find is an SPI-to-USB interface to plug into your computer. 

 

Another option could be the USBUART component, which emulates a COM port, communicating through USB to Virtual COM ports on the computer. I couldn't find the max supported speed on a quick look at the datasheet.

 

The USB protocol could be another way to go, although you did specify you wanted "simple". 

 

 



Re: Simple Digital Communication with PC

hli posted on 16 Apr 2013 12:50 AM PST
Top Contributor
675 Forum Posts

200k samples per second mean you need to push at least 1.6mbit/second to the PC (maybe even more when you count in overhead). This will be difficult to get with USBUART on a constant basis - typically these protocols send one USB packet per transmitted byte, which gets you high latency.

You will need to test this and check that you can the the desired performance.

Otherwise, SPI will be simple from a PSoC perspective - but on the PC side it will be more complicated.

The best way would be, IMHO, to use pure USB communication. You can do bulk transfers, and can be sure to get the transfer speed you need.



Re: Simple Digital Communication with PC

PSoC73 posted on 16 Apr 2013 01:07 AM PST
Top Contributor
176 Forum Posts
I recommanded you to USB BULK Transfer Or plus DMA. The example is easy and working well unlike of PSoC1.

Re: Simple Digital Communication with PC

Bob Marlowe posted on 16 Apr 2013 01:46 AM PST
Top Contributor
1768 Forum Posts

A problem on the PC-side will be that you do not have a real-time operating system, but a multitasking Windows. Besides checking for latest updates for your software, windows runs ~100 processes which will take some MIPs delaying the transfer of your Data or rather: slicing the transfers into packages which are difficult to predict when get transferred.

 

Since you are probably not measuring 24 hours a day, you can estimate the overall amount of data that needs to get buffered and choose an adequate medium (ie. SRAM ) to temporarily store the information. I think, you'll have to dig deep into the trick-box and pull out some of the procedures (double buffering, circular buffers, interrupt driven, DMA) to get your requirements solved.

 

Bob



Re: Simple Digital Communication with PC

hli posted on 16 Apr 2013 03:54 AM PST
Top Contributor
675 Forum Posts

@Quick: can you tell us a little bit about what you want to do? How are these samples generated, and how long will the measurement process last?



Re: Simple Digital Communication with PC

zeta posted on 16 Apr 2013 06:43 PM PST
Top Contributor
174 Forum Posts

Usign UART you won't get transfer rates higher than 5KBps.

Generally, the easiest way to pass data to a computer is using the USB-HID cass, as you dont have to write drivers. Unfortunatelly, despite it being 10 times faster than UART, you won't be able to get rates of 200KBps. Your best bet is using CDC USB class. Cypress USB suit should help you with that.



Re: Simple Digital Communication with PC

zeta posted on 16 Apr 2013 06:52 PM PST
Top Contributor
174 Forum Posts

 @Bob

 

You won't notice any performance issue on the Host side. An entry level computer nowadays have much much more prossesing power than required to deal with all threads plus USB. 

 

on the device side, using 2 DMA channels, the first to move data from ADC to memory and the other to move data from memory to USB endpont, should solve any performance issue.



Re: Simple Digital Communication with PC

PSoC73 posted on 16 Apr 2013 09:42 PM PST
Top Contributor
176 Forum Posts
Yeah, Cypress FX2 USB driver is easy to use (CyUSB.dll) It's included USB suits. Easy to programming by .NET API, NET.VB and NET.C#




ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20