View previous topic :: View next topic |
Author |
Message |
hardyethan
Joined: 28 Jan 2009 Posts: 2
|
PIC18F4550 - help!! |
Posted: Wed Jan 28, 2009 4:30 am |
|
|
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
|
|
Posted: Wed Jan 28, 2009 5:37 am |
|
|
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
|
|
Posted: Wed Jan 28, 2009 5:06 pm |
|
|
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
|
|
Posted: Thu Jan 29, 2009 5:26 am |
|
|
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
|
|
Posted: Thu Jan 29, 2009 8:24 am |
|
|
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
|
|
Posted: Mon Feb 02, 2009 8:35 am |
|
|
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. |
|
|
|