Shop OBEX P1 Docs P2 Docs Learn Events
How to make DSO with streamer? — Parallax Forums

How to make DSO with streamer?

Thinking that the streamer should be good for capturing pin data...
If I'm seeing right, should be able to capture up to 32 pins at full clock speed with one cog.

What I'd like to do is have the streamer continuously capturing data and then stopping at some trigger signal.
Then, want to display data with trigger event in middle of trace. This is the part I don't see how to do...

Now that the streamer is double buffered, seems I can't just stop it at an arbitrary time...

Maybe need to alternate between two input buffers?
I guess there's a new command to get the streamer count. So, I guess I'd read that as soon as the trigger event occurred.
That would be somewhere in the first buffer somewhere, and then I could stop the streamer after the second buffer is full.
But, it could be that I didn't get enough data in that first buffer, pre-trigger...

Maybe I need to rotate between 3 buffers?

Any way to do this with 1 buffer?

Comments

  • cgraceycgracey Posts: 14,209
    Make a circular buffer that is some power-of-2 in size, so that GETPTR can always return the correct LSBs of the write address (GETPTR doesn't wrap, it just advances).

    Do a 'WRFAST bufferlongs_div_16,bufferstart' to set up fast writing

    Do an 'XINIT ##$F000_FFFF,#0' to start capturing INA.

    Next, set up a pin-match event.

    Wait for the event, then stop the streamer using 'XINIT #0,#0'.

    Use the GETPTR instruction to figure out about where you left off in the buffer. Then, back up, checking each sample for the trigger state. It should be several samples back.
  • cgraceycgracey Posts: 14,209
    edited 2015-11-24 00:40
    I think it would be easy to add a mode for streamer byte/word/long pin input, where it only grabs a byte/word/long when it sees a high/low/any transition on some pin.
  • RaymanRayman Posts: 14,768
    edited 2015-11-24 01:55
    Thanks
    Sounds like xinit 0,0 will interrupt and stop steamer
    So, just wait for trigger, get ptr, wait a moment to get more samples then stop streamer and process
  • jmgjmg Posts: 15,175
    cgracey wrote: »
    I think it would be easy to add a mode for streamer byte/word/long pin input, where it only grabs a byte/word/long when it sees a high/low/any transition on some pin.

    You mean via smart pins ?
    There is also a similar FIFO mode, which would work with the FTDI high speed USB devices.

    Some logic analyzers work by time-stamp where a Pin-change loads a counter value, and the Pin-group, as a capture pair.
    This slashes the memory needed for Logic capture, and gives large dynamic range zooms.

    With counters in the pins, that's probably quite easy to do ?

Sign In or Register to comment.