Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: jonr

Search: Search took 0.00 seconds.

  1. > connect one ADC to a voltage reference and read...

    > connect one ADC to a voltage reference and read the signal on the other

    Yes, ideally with the voltage reference being near the signal source and both lines treated exactly the same (ie,...
  2. Note that while the T4 doesn't have a pseudo...

    Note that while the T4 doesn't have a pseudo differential mode, with two converters, one can sample the signal and a reference voltage at about the same time. So similar common mode noise/offset...
  3. But I see nothing that indicates the equivalent...

    But I see nothing that indicates the equivalent pedvide _SPEED library settings for the defaults of AnalogRead().
  4. Looks like AnalogRead() normally uses averaging...

    Looks like AnalogRead() normally uses averaging of 4 samples. Not sure about other settings.

    Not sure what you expect, one or even a few bits of noise isn't bad.
  5. Let us know what works.

    Let us know what works.
  6. Also try a capacitor from the piezo negative to...

    Also try a capacitor from the piezo negative to ground.
  7. Like this: ...

    Like this:

    https://electronics.stackexchange.com/questions/275755/rc-low-pass-filters-for-op-amp-power-in-pins

    You may not notice the difference.
  8. You can try a 10 ohm resistor and then a 10u...

    You can try a 10 ohm resistor and then a 10u capacitor on line from power supply to the op amp.
  9. The reference manual says that 4K ohms is low...

    The reference manual says that 4K ohms is low enough source resistance for a T4 ADC input. 1K will be fine, even if an adjustment is needed for higher speed modes. Lower won't make any difference.
  10. Do add some filtering on the output of the op...

    Do add some filtering on the output of the op amps to reduce noise. Try a 1K resistor in series followed by a .1u capacitor to ground. Change capacitor as needed.
  11. > adc->adc1->setAveraging(1); You can change...

    > adc->adc1->setAveraging(1);

    You can change the 1 to 2 or more for less noise. Also consider posting a schematic to get a lower noise design - there is more to it than just here and there...
  12. > try >> 1 shift instead of / 2 No difference,...

    > try >> 1 shift instead of / 2

    No difference, the compiler is smart about such things. On the other hand, pedvide uses some odd/slow types, so a (uint32_t) cast is needed in this case. Added.
  13. Here is a trick that should work. Say you only...

    Here is a trick that should work. Say you only need to read 1 pin, but want it fast and with .5 bits less noise. No sense is leaving an ADC idle when it will reduce noise.


    ADC::Sync_result sr...
  14. IMO, the best way to read 10 pins quickly. ...

    IMO, the best way to read 10 pins quickly. There are other ways if you want to do something else while the conversions are being done.


    for (int i = 0; i < PINS; i += 2)
    {
    ...
  15. > pinMode(adc_pins[i], INPUT); Paul doesn't do...

    > pinMode(adc_pins[i], INPUT);

    Paul doesn't do this and explicitly says not to. And I get very different ADC results when I do. So I think it's clear - don't do it.
  16. > pinMode(adc_pins[i], INPUT); AFAIK, this...

    > pinMode(adc_pins[i], INPUT);

    AFAIK, this configures a pin for DIGITAL input - not what you want, so delete this section.
  17. Put this at the top: "#define ADC_TEENSY_4_0" ...

    Put this at the top: "#define ADC_TEENSY_4_0"

    > I need 200 ADC readings per ms in total.

    No problem, the T4 can read the ADC at more than 700 samples per ms. > 1200 if using both ADCs.
  18. +1 on measuring timing. There some...

    +1 on measuring timing. There some non-intuitive things that even experts don't expect.

    Yes, do use lots of functions and pass all of the needed variables to them.
  19. Less scope is better, so much so that when you...

    Less scope is better, so much so that when you are starting out, you should program without using ANY global variables. It will force better coding practices.

    For example, "for (int i = 0 ; i <...
Results 1 to 19 of 19