Shop OBEX P1 Docs P2 Docs Learn Events
Prop based analog 60msps oscilloscope possible(?) — Parallax Forums

Prop based analog 60msps oscilloscope possible(?)

tonyp12tonyp12 Posts: 1,951
edited 2012-02-28 22:38 in Propeller 1
attachment.php?attachmentid=90007&d=1330214229

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:
587 x 139 - 20K

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2012-02-25 16:39
    Looks great.

    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.
  • kuronekokuroneko Posts: 3,623
    edited 2012-02-25 17:02
    tonyp12 wrote: »
    So could it reach the 60 million samples per second???
    Provided you can deliver the input that fast, sure.
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-02-25 17:04
    >Therefore 4 cogs intertwined can sample at 10ns

    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.
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-02-25 17:08
    >Provided you can deliver the input that fast, sure.

    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
  • kuronekokuroneko Posts: 3,623
    edited 2012-02-25 17:13
    You'd have to change your sample loop slightly though :)
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-02-25 17:46
    OK. I gather that you are not actually going to read the adc data into the prop at all, but connect the adc to the USB chip directly and provide the 60MHz clocking to the USB chip to achieve this.

    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.
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-02-25 18:14
    The Prop will enumerate with PC's usb host
    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.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-02-25 18:23
    The prop uses an internal PLL to multiply the external xtal *16 and then a divider chain to get to the correct value to be used as a clock. However, IIRC, any clocks generated by the VGA or counters use their own PLL and they have jitter. You do need to check this carefully as the jitter could cause problems. Unfortunately I cannot help in this area.

    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.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-02-25 18:28
    Uh, I don't know if you'll be able to define endpoints and talk ULPI properly. I don't know enough about USB to do this, and it sounds like you have research to do, yet, too. ULPI is not a simple interface to work with - it's just a lower clock rate that you can talk at 3.3v easily.
  • RaymanRayman Posts: 14,844
    edited 2012-02-25 18:51
    I've thought a lot about a Prop scope too...
    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...
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-02-25 19:52
    There will be options to select gain and offset.
    Probably just a few "digital" steps.
  • jmgjmg Posts: 15,183
    edited 2012-02-25 19:54
    tonyp12 wrote: »
    The USB chip can handle a little jitter and it's rated for High-Speed USB2.0 (60mhz*8bits=480)

    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.
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-02-25 20:29
    The USB chip has small buffer, and trigger is done in software on the PC as you can view in real time or save it and zoom in later. And dso203 does what 1msps?
  • jmgjmg Posts: 15,183
    edited 2012-02-26 00:21
    tonyp12 wrote: »
    The USB chip has small buffer, and trigger is done in software on the PC as you can view in real time or save it and zoom in later. And dso203 does what 1msps?

    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.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-02-26 00:23
    Dso203 samples at 72 or 144 MHz. Analog front-end is insufficient for that bandwidth, though.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-02-27 08:48
    tonyp12 wrote: »
    attachment.php?attachmentid=90007&d=1330214229

    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:


    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
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-02-27 09:19
    This is the analog front end I will base it on, for the gain/offset I will be using the props 26ohm internal pin resistance to create 4 steps etc.
    attachment.php?attachmentid=90087&d=1330362818

    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.
    427 x 276 - 32K
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-02-27 13:45
    Hate to burst your bubble, but this won't work. Unless you can lock down the bus so that no other devices ever show up on the USB2.0 host, you won't get a continuous 60MBps. You still won't because the computer has to request data from the device before it can answer. On a typical motherboard, there is rarely more than one EHCI host controller, and it usually drives all the USB ports on the system. My new laptop has 2 EHCI controllers, but that's pretty unusual.

    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.
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-02-27 14:20
    So I sample at 60mhz and avarage two samples and send it at as 30msps(240mbps)
    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.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-02-27 14:45
    You still need the packet headers that define what endpoint the data is coming from, and you need to wait for the PC to request data.
  • Andrey DemenevAndrey Demenev Posts: 377
    edited 2012-02-28 00:24
    Why one would need Propeller here? Why not connect the ADC directly to the USB chip?
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-02-28 08:21
    As the data packet can only be 1024bytes
    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
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-02-28 22:38
    tonyp12 wrote: »
    As the data packet can only be 1024bytes
    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
Sign In or Register to comment.