CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Anyone have already reached more than 500kbps using USB?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

Anyone have already reached more than 500kbps using USB?
PostPosted: Mon Feb 06, 2012 7:48 am     Reply with quote

Anyone have already reached more than 500kbps(kilo data bits/second) using USB?

I´m currently using PIC18F26J50 at 48MHz, with internal peripheral USB. I used CCS USB driver, configured with usb_cdc driver.
I´m using the function usb_cdc_putc() in eternal looping for sending chars. I´m using windows Hyperterminal for receiving chars(921,6kbps 8N1). This CCS cdc driver is very interesting as it does not care whether you configure 921,6kbps or 110bps(or any other speed). It accepts any configuration and seems to not limit throughput. I confess that´s good for me! Wink

I tried using usb_cdc_putc_fast() function for transfer data, but with just a little increase to 540kbps. It´s not enough for my project.

I checked with oscilloscope that USB bus is running at 6MHz, so i think it´s 12Mbps capable(12 mega bauds/s).

Anyone have ideas for increasing USB throughput?
I´m planning transfer the content of a SPI flash memory. I can drag Flash content at 6Mbps using SPI and pic DMA feature.

Thanks a lot for any ideas or information Laughing
_________________
Eduardo Guilherme Brandt
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Mon Feb 06, 2012 9:06 am     Reply with quote

It´seems that, for that, I need to do an USB "bulk transfer"(for more than 500kbps). Anyone knows whether is it possible to do this using CCS USB drivers?
_________________
Eduardo Guilherme Brandt
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Mon Feb 06, 2012 9:15 am     Reply with quote

You need to be looking at using bulk transfers, not interrupt transfers.
Interrupt transfers are designed to give reliable relatively 'smooth' transmission of data with only short gaps in the transmission. This is how a CDC device wants it's data to behave. Hence, small packets at reasonably quick intervals, but with no aim for really high speed.

Bulk transfers are needed to get the best performance, give the maximum bus performance for a short while, however they also can have quite large transmission 'gaps' when other devices are on the bus.

Isochronous bulk transfers are potentially a combination of both, with a pre-negotiated amount of bus time being allocated to the specific device at a regular interval, to give a defined latency.

You are misunderstanding what setting the baud rate 'does' with USB CDC. When you set the baud rate, all that is done is that a message is sent to the peripheral device saying 'this is the baud rate selected' If you are emulating a RS232 or similar peripheral, it is then up to the code in the device to change it's output settings to match. The CCS code in the PIC, receives this message, and passes it to you (set line coding is flagged). It is up to your code then to change speed if required. The 'driver' changes nothing itself in the communication up to the peripheral device.
There is actually no 'CCS driver' involved here - all CCS supply is a .inf file, which tells Windows to use it's own CDC driver.

You are using the wrong tool. A bit like trying to move snow with a teaspoon. Yes, it can be done, but a shovel will always be faster.

usb_desc_scope.h, is the example of setting up an _HID_ device (not CDC), to use bulk transfers.

Best Wishes
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Mon Feb 06, 2012 10:37 am     Reply with quote

Thank you very much Ttelmah.

I´ve just found some idea here, about bulk transfers: http://debusinnovations.blogspot.com/2008/03/usb-bulk-transfer-device.html


Despite of that, I´m going to see the example you suggested-me usb_desc_scope.h . I think it may be easier.
_________________
Eduardo Guilherme Brandt
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Feb 06, 2012 1:19 pm     Reply with quote

I remember to have achieved around 1 MBPS in a CDC echo application. This has been with an AT90USB processor, but it's roughly in the PIC speed range.

Most issues have been with tuning the PC side accordingly.
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Mon Feb 06, 2012 3:22 pm     Reply with quote

FvM wrote:
Most issues have been with tuning the PC side accordingly.


Dear FvM, but how can I tune PC side? What's the client software you were using?
_________________
Eduardo Guilherme Brandt
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Feb 07, 2012 12:50 am     Reply with quote

I've been operating the virtual COM interface with generic Windows SDK readfile() and writefile(), while observing comstat information. The behaviour has been slightly different between Windows versions.

The trick is to keep the TX buffer filled to make the driver send more than one 64 Byte packet per USB 1 ms tick. It's useful to have an USB software monitor that shows the bus activity.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group