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

Thread: Fastest accurate sampling rate on teensy 3.2

  1. #1
    Junior Member
    Join Date
    Dec 2019
    Posts
    2

    Fastest accurate sampling rate on teensy 3.2

    Hi everyone. This is my first post. Currently I'm using a teensy LC to sample an analog signal with frequency between 1 and 10Khz for the purpose of performing a FFT and calculate phase and magnitude at the defined frequency bin. For it, I use the interval timer library and am able to accurately sample with a 30 microsecond timer, with FASTRUN, 0 priority, and SCB_SHPR3 = 0x20200000, and using the Adc library example with interval timer made by pedvide. However, I now need to sample ac signals with frequencies up to 30Khz, and, when I lower the sampling period, i.e. myTimer.begin(function, 20 or 10 microseconds) a higher variance is induce in the phase calculation. I should note that I am not averaging adcs adquisitions for each sample. Only one sample point is taken for each value of my FFT array. For this reason, I would like to know if anyone knows if I will be able to sample at 60Kz (15 microsenconds timer interrupt) or more for oversampling purposes (at least 10 microsecons) on a teensy 3.2 without problems.

    Thanks!

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,383
    Make this call in setup() and see if it completes any faster: analogReadAveraging(1);

    IIRC by default the internal hardware averaging does 4 reads per returned sample.

  3. #3
    Junior Member
    Join Date
    Dec 2019
    Posts
    2
    Hi. Yes. I am already using that instruction. I can sample at ten microsenconds with the teensy lc, but the results are not accurate. That is why I wanted to know if perhaps using a teensy 3.2 could solve that problem.

Tags for this Thread

Posting Permissions

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