Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 25th June 2008, 04:29 PM   (permalink)
Default Building a PIC based oscilloscope

I know there are projects like this out there, but I would like to attempt my own.

I would like a high speed analog front end feeding an external ADC interfaced to a PIC via SPI, and PIC to PC via USB, and a Visual Basic or C# program written to display the data. This is somewhat of a big project, but I think I can pull it off given my past experience.

First question: What is the max transmission speed of an 18F series pic on the SPI bus? I can't seem to find it in the data sheet.
speakerguy79 is offline   Reply With Quote
Old 25th June 2008, 07:12 PM   (permalink)
Default

alright this might be way off but i imagine your best bet would be to find a REALLY old one and try to emulate what the components are doing. i think a CRT screen would be a must since the inputs would be so much easier
mashersmasher is offline   Reply With Quote
Old 25th June 2008, 08:58 PM   (permalink)
Default

Max clock on the SPI for 18F2525 is Fosc/4 (or Tcy). Document is DS39626E-page 166.

If you have a different PIC family, search for SCK.
mneary is offline   Reply With Quote
Old 26th June 2008, 01:46 AM   (permalink)
Default

Mkay, so with a 40MHz xtal oscillator, anything more than 10Msps is definitely a waste. And I probably can't even come close to that when you consider overhead of the SPI and USB functions for two channels.

I essentially want two channels of data to the PIC as fast as it can go, and the PIC spitting it out over USB2.0 to the PC. Any idea what kind of sampling rate I would be looking at overall for a dual channel system?
speakerguy79 is offline   Reply With Quote
Old 26th June 2008, 01:54 AM   (permalink)
Default

With a 40MHz oscillator, your transfers will take on average 4*10 Fosc, or 1 MHz max.
mneary is offline   Reply With Quote
Old 26th June 2008, 02:21 AM   (permalink)
Default

I was just looking at the dsPIC4011 with it 30MIPs run clock and 1000ksps 10bit A/D would make a nice scope PIC.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 27th June 2008, 05:59 AM   (permalink)
Default

SPI speed will be listed under Electrical Specifications, in the form of required delays.

Keep in mind a scope generally won't continuously dump data to the computer. This could exceed viewable speed. Instead, you have a triggering event, capture say 256 samples, and you may not begin capturing on the next triggerable event if it's too soon. But capture speed is still very important because that affects your max sampleable frequency. 100ksamp/sec would not correctly read components above 50khz (Nyquist rate).

Note that the 30F series has pretty high power consumption at high speeds, and it's not as fast as the lower power 33F. There's faster 33F devices up to 1.1Msamp/sec IIRC, and the processor's up to 40MIPs. You probably need a USB port for sure though. There's also the new PIC32 line, half the product tree has USB.
__________________
I thought what I'd do was I'd pretend I was one of those deaf-mutes.
Oznog is online now   Reply With Quote
Old 27th June 2008, 08:34 AM   (permalink)
3v0
Default

To see data prior to the trigger you must start sampling data at run and continuously sample up to and some distance past the trigger event.
3v0 is offline   Reply With Quote
Old 27th June 2008, 10:11 PM   (permalink)
Default

I realize this is not as fun as doing it yourself, but have a look at this:

pcscope @ yahoo . co . uk
pc88 is offline   Reply With Quote
Old 28th June 2008, 09:32 AM   (permalink)
Default

Yes the simplest way to do it would be a dsPIC they have internal ADCs capable of 1000ksps and some even 2000ksps. An external SPI ADC would not provide much better because the SPI line will run at max 40Mhz for the high end dsPICs.So if the ADC takes 1 byte of data to get 1 sample you get 5000ksps.

For a real good scope a difrent method must be used.A ADC with parallel output (all high speed ADCs are like that for the obvius speed problems of SPI) and just connect its data lines to a RAM chip.Then there is a binary counter connected to the RAMs address bus and the clock line of the counter and ADC conected to a oscilator. So for evry pulse of the clock line 1 sample is stored in to the ram chip. With this method i guess up to 100Msps is posible. Also this would preferdaby be asembeld from SMD components on a well designed PCB because you are dealing with very high freqency signals.

As for the analog front end you should have a good modern opamp to amplify the signal so you can have a like 100mV and 10mV range and some kind or resistor divider cirucit to provide the ranges for voltages higher than 5V. Also you need to have a AC and DC setting where the AC has its 0V at acualy half of the supply voltage so the signals that go below 0 dont get cut off.

But for a start a dsPIC and its internal ADC should do.
__________________
Il give you shocking experience.
Someone Electro is offline   Reply With Quote
Old 28th June 2008, 06:43 PM   (permalink)
Default

thats a very good price but what is the top frequency ?
__________________
I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

my site:www.simons-photography.com
http://rushdenrotaract.org.uk
see also
http://www.bigstockphoto.com/account...fid=m2URATYch5
http://www.redbubble.com/people/simonsphotography
Thunderchild is offline   Reply With Quote
Old 29th June 2008, 12:08 AM   (permalink)
Default

Quote:
Originally Posted by Thunderchild View Post
thats a very good price but what is the top frequency ?
The sample rate is 800 Ksps, but see this for the difference between sample rate, analog bandwidth and effective bandwidth:

PC Based Digital Storage Oscilloscope Adaptor Mk3

Also, see this on "real-time equivalent sampling":

Real-Time Versus Equivalent-Time Sampling > Application Note : Tektronix
pc88 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
PC Based Oscilloscope ml_natasha Electronic Projects Design/Ideas/Reviews 7 10th September 2006 01:05 PM
PC-based oscilloscope mshemyalnisar Electronic Projects Design/Ideas/Reviews 9 30th July 2006 07:58 PM
PC-based oscilloscope Natasha125 Electronic Projects Design/Ideas/Reviews 2 27th March 2004 04:00 AM
PC-based oscilloscope Natasha125 General Electronics Chat 2 26th March 2004 06:04 PM
PC-based oscilloscope Natasha125 General Electronics Chat 3 2nd March 2004 03:39 PM



All times are GMT. The time now is 08:47 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.