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 support@ccsinfo.com

PIC18F4550 - help!!

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



Joined: 28 Jan 2009
Posts: 2

View user's profile Send private message AIM Address

PIC18F4550 - help!!
PostPosted: Wed Jan 28, 2009 4:30 am     Reply with quote

hi all,
I am trying to do a PC based oscilloscope with usb interfaceof 2Mhz bandwidth. we use a separate ADC ic with sampling rate 20Msps.
when i came around the pic datasheet it says 18f4550 operates at 48Mhz freq to work in usb2.0 - 12Mbps spec.

will i be able to interface this high speed-adc without any data loss? bcos i dunno if the pic18f can take in data of 20msps data rate.

pls help

HE
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Wed Jan 28, 2009 5:37 am     Reply with quote

20 Msps is too much.

To get a maximum sampling rate, try to use a parallel external ADC instead of a serial one

Good Luck
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Jan 28, 2009 5:06 pm     Reply with quote

Another thing to consider is what you are going to do with the sampled data. You can't store it in FLASH because that is way too slow. Internal RAM of the largest PIC18 is only 3968 bytes, or about 200us at 20Msps....

I recommend to consider using another processor. ARM chips, for example, are not expensive, have lot's more processing power and RAM than a PIC18 and there is a good open source compiler.
Ttelmah
Guest







PostPosted: Thu Jan 29, 2009 5:26 am     Reply with quote

Worth adding, that scopes like this, don't work in realtime to a PC.
Basically if you look at units on the market, they all sample to their own internal memory, then allow the results in this to be transferred to the PC, from this buffer.

You are several orders of magnitude 'short' of being able to do this in realtime.
Assume your ADC is 8bit (you don't say).
20Msamples/sec, is then 20MB/sec. 160Mbps.
USB 2.0 'full speed', can clock a maximum of 12Mbps. However at 'best', you will be lucky to get 3/4 of this (remember the bus has overheads). With the PIC, perhaps 1/2, and then only with a lot of careful coding. So a factor of nearly 30* 'short'...
Even with a much faster processor, and running at _high speed_, while 'do-able', you _wil_ find problems. USB, on most PC's, is doing quite a few transfers al the time now (keyboard and mouse at the minimum). Add a few more drivers, talking to other devices, and there _will_ be breaks in the transfer. Again the buffer becomes essential.
You need to rethink your approach. A faster processor, with enough memory to hold a reasonable number of samples, and the external hardware to control when sampling starts (equivalent to a scope 'trigger'). Then an interface to the PC, using at least USB 2.0 high speed.

Best Wishes
crystal_lattice



Joined: 13 Jun 2006
Posts: 164

View user's profile Send private message

PostPosted: Thu Jan 29, 2009 8:24 am     Reply with quote

Ttelmah is USB 2.0 Full Speed not maxed at 480Mbps? From what I've read USB 1.0 supported 1.5Mbps and 12Mbps and USB 2.0 bumped it up to 480Mbps.

USB 3.0 boasts the new SuperSpeed @ 5Gbps according to the new spec sheet.... will have to wait for a pic supporting this hardware....

The link for anyone interrested:
http://www.sparkfun.com/tutorial/news/USB%203.0%20Spec.pdf
magestik



Joined: 16 Oct 2008
Posts: 59

View user's profile Send private message

PostPosted: Mon Feb 02, 2009 8:35 am     Reply with quote

USB low speed = 1.5Mbps
USB full speed = 12Mbps
USB high speed = 480Mpbs

If you see USB 2.0 full speed, it ain't the real USB 2.0 which support 480Mbps.
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