Prop based analog 60msps oscilloscope possible(?)
tonyp12
Posts: 1,951
A small pen based +5v / -5v Analog Oscilloscope
The Prop will be the master generating the 60mhz clock needed for both
the USB 2.0 ULPI Transceiver and the 60msps ADC
It should be esier to stay in sync if the Prop is in control of the clk.
Running the Prop on a 6mhz crystal
or is other freq better?, as 60mhz = 16.667 ns
a 7.5mhz with 8x pll or a 3.25mhz with a 16x pll?
All 8 cogs sample one clk after each other so that would be 10ns
ADC is 8bit on 8 pins
No buffers, no writing to hub
The plan is to read the byte and have video pixel receive is at exact handoff time.
As all 8 cogs will be using it's vga mode to serialize the data and send it to the 8pin parallel ULPI Transceiver (480mbps)
The PC software would have to decode it back as it would be pretty mixed up.
So could it reach the 60 million samples per second???
If what the cogs have to do is: (should take each cog 80ns)
label: movs pixel,ina
jmp label:
Comments
A 6.25MHz xtal which overclocks the prop to 100MHz results in 10ns clocks in the prop. Therefore 4 cogs intertwined can sample at 10ns. But this really depends on the ADC chip and how you are accessing it.
You would have to unroll the sample loop and have jmp at the end to get a cog to sample in just one instruction.
Though their would be a glitch at the jmp, I think the PC program could interpolate data for that point.
As I don't think anyone have been successfully with rollover with the cogs pc counter automatically.
Yes I can, using a 1.7ghz opamp coupled togheter with a 60msps (70max) rated 8bit ADC.
So I will now set this product in motion and I plan to sell it for under $90
Will the usb chip keep up to the full 480Mbps required by the adc? Will the pc be able to keep up with this?
I presume you will use the prop to initialise the USB chip and then go into passive mode, while supplying the clocks.
There are issues with the prop generating clocks without jitter. I canot answer these problems and whether they may affect what you are doing. PhiPi is probably the best equiped to answer this.
The prop may skip the listing in on the usb request as data may coming in to fast.
So I will just send the answer I know it wants using vga-mode.
As using 8 cogs on outputs with regular "mov outa,data" does not work as pins would be or'ed.
The USB chip can handle a little jitter and it's rated for High-Speed USB2.0 (60mhz*8bits=480)
But that is why I want to use a crystal that is ^2 to 60mhz just to play nice.
I guess I could simple hook up the ADC directly to the USB chip and have the Prop supply the other 4 signals needed.
But now there is hardly any job for the Prop to preform as I'm pretty sure the usb chip does the NRZ encoding etc.
Unless there is enough time to use the Hub and therefore could provide a 8k buffer if the PC's usb host stutters from all this Isochronous Transfer.
Perhaps you might ask Parallex Engineering for some help here. See the Parallax Semiconductor tab above for help in asking this. they are setup to answerquestions for professional developers using the prop.
I think the digital side is one thing. But, you also have to think about the analog front end...
Unless it's a logic scope, you need programmable amps on the front end...
Probably just a few "digital" steps.
That calc misses packet & protocol overheads, and USB actual data rate is not deterministic.
I can see no mention of a trigger, and that is the cornerstone of a good scope.
In getting a FT232 to even hit 12 MBd, I found large buffer sizes were needed.
A good example of a Scope+Screen, is the DSO203 on eBay. Hard to compete with that.
You are thinking of the older model, which uses a uC ADC, the new DSO203 one has a FPGA and a 4 channel sampler, gives 36+36MHz.
Just a couple observations:
1. I may have missed it, but I see no input filter, i.e. lowpass w/ a 30mhz cutoff, so expect aliasing from any higher freq components in the input
2. While a 60 msps adc can theoretically give you a 30mhz max, that means only two samples per period. Moderm dsos use timing gtrickery to obtain a useable waveform, and that only on periodic waveforms.
3. You need some sort of sample buffer to match the transfer speeds between the adc, usb, cpu input rate as well as control signals, and a lot more.
Before jumping off into diy scope design, get hold of some adcs and experiment w/ capture, sample rates etc. I have found it very enlightening not to mention fun. Eventually I will return to the curve tracer, but much remains on my need to master in the A/D gray zone..... and I have not yet moved into input filtering, processing and all the rest of the goodies in Caxton Foster's chapgters on the same!
FF
I will make a few plug in boards for quickstart with 1msps spi adc or something to test it out, as learing the USB enumeration is the hard part.
But could be useful info for when the Prop2 comes out.
I suspect you plan to have the device enumerate with one "In" endpoint and no "Out" endpoints, but I'm not completely sure that's even a legal device description. From there, you still need to add headers/footers to the USB packets before they can be sent, the host has to wait for the bus to not be busy, and you need to wait until the host requests data, then only send what's requested. I doubt you can clock the prop fast enough to generate the headers necessary for Isochronous data transfer.
If you want to stream large amounts of data, you're much better off with FireWire, as it has better high-performance streaming support, and can actually approach it's stated 400Mbps while USB rarely gets above 250Mbps despite the theoretical speed advantage. Also, the prop may just be able to generate the headers needed, if you clock it at 100Mhz, but that would still require external help.
Could call it a "real 30msps" ocsillo.
The usb chip takes care of sync bits and eop, so that part I don't have to worry about so I just need to send 1024bytes packets.
The ADC can handle an adjustable clock on the fly, so I could throttle it too.
So the Prop would have to wait for access from the usb host, insert headers in the packet to send the next chunk.
May get away with simply tri-stating the ADC while doing this so it actually could be connected directly to the USB link.
But it's still better to sample at twice max real life usb rate and have the prop doing an average on them,
probably would have to be running the Prop at 120mhz/3.6v
Actually, what you would be best off doing would be using the prop as a control/interface processor. Run it at prop speeds and then handle all control and transfer via the prop and usb devices. Set up your input analog filter so that the cutoff freq=1/2 sample clock speed. Use the prop counter or other method to develop the sample frequency and combine that clock with the appropriate glue and register logic to create a state machine that will capture and store the output of a Parallel output ADC device into one of 1024 samples sequentially. Use the prop to setup and select the state machine functions for the capture. Now, for more analog work, to create a trigger circuit that you could say program a DAC to feed one side of a comparator and the input should source a buffered/amp'd value for the trigger level. Once 1024 samples are captured then the prop can direct the transfer to the scan to the PC for viewing and storage.
You may want to make the sample clock 10x the frequency in question so that the waveform actually looks like something. If you simply go with the 2x max freq present, and are sampling near that input, you will not really know what you have. 2 points on a sine / square / triangle wave will be just two points. What lies between? No way to tell unless there are enough samples to enable a reasonable reconstruction.
This would be a great learning project at reasonably low frequencies and you will gain serious insight into the gray world of A/D & D/A, but otherwise spend the money on a good scope if that is what you are really after.
FF