Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: "Continuous mode"

  1. #1
    Junior Member
    Join Date
    May 2017
    Posts
    13

    "Continuous mode"

    I've seen mention of "continuous mode" and "continuous measurements" but can't seem to find what it is, why I would want it, or how to use it. I have browsed through the thread at: https://forum.pjrc.com/threads/25532...for-Teensy-3-1 but I'm not getting it.

    Is there something like the Arduino Reference page for continuous mode and other Teensy-specific functionality?

    To provide some background, I have a project in which I have six external waveforms that I wish to measure using my Teensy 3.6. When an interrupt occurs, I want to "look back" at the history of these waveforms and pick some specific points from the array of values for each one. Yes, my life would be much easier if the interrupt signal happened first and I could just start logging data at that point, but the design of these waveforms and signals is not in my control.

    At the moment, I'm just using an analogRead in the main loop to constantly write the current measurement into an array after shifting all the existing values first. My concern is that the exact time these values go into the array may not be constant since the number of CPU instructions per loop can change due to a variety of conditional statements. I'd prefer to use modulo and micros() to take a sample every 25 microseconds, but this method seems to miss some measurements based on a side-by-side with my oscilloscope. My goal is to have six buffers/arrays of data to always contain the last 3ms of analog measurements in 25 microsecond increments.

    Whether "continuous mode" helps me or not, I'd like to know more about it. Thank you in advance for any explanation.
    DPM

  2. #2
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,792
    That thread is the one you are after, the library should be part of your existing teensy install and analogcontinuousread example would be the place to start, noting you need to enter serial commands to kick the continous read process into action.

  3. #3
    Senior Member
    Join Date
    Jul 2013
    Posts
    272
    Continuous mode means that the ADC is measuring all the time; that is, it doesn't stop when it gets a result and keeps updating it. Based in your description it's not really what you want.
    If you want to take periodic measurements have a look at the pdb or the IntervalTimer examples of the ADC library, then you'll need to use a ring buffer to keep the last N data points.
    Measuring 6 signals every 25us will be hard, including putting the data into the buffers, hopefully the impedance is very low so you can use the fastest settings.

  4. #4
    Junior Member
    Join Date
    May 2017
    Posts
    13
    Ok thank you very much to both of you for the explanation and the suggested example files. This helps!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •