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

Thread: Teensy4 ADC Word Size

  1. #1
    Junior Member
    Join Date
    Sep 2019
    Posts
    3

    Teensy4 ADC Word Size

    I'm currently working on redesigning a project that utilizes the Teensy 3.2 to use the Teensy 4. The Teensy 3.2 in my design is used for analog data collection, as well as a number of other things. Pins A10 and A11 are currently being used as they support 16b analog acquisition. On the Teensy 4, which pins support 16b word length?

  2. #2
    Junior Member
    Join Date
    Sep 2019
    Posts
    3
    For anyone interested, I did some testing with the Teensy 4 I just got in, and none of the ADC pins are 16b. All of them are 12b.

  3. #3
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,117

  4. #4
    Junior Member
    Join Date
    Sep 2019
    Posts
    3
    Yes I did. Here's the code I used to test it.

    Code:
    #define READ_PIN A0
    
    void setup() {
    	analogReadResolution(16);
    	analogReadAveraging(32);
    }
    
    void loop() {
    	Serial.println(analogRead(READ_PIN));
    	delay(1000);
    }
    It's not an elegant way of figuring it out, but it did the job. Basically, I manually changed the analog read pin in the code, uploaded the sketch, and then connected the pin under test to 3.3V.

    Watching the serial monitor, it would read out a maximum of 4096 (2^12) instead of the expected 65536 (2^16).

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,970
    Quote Originally Posted by joebobs0n View Post
    For anyone interested, I did some testing with the Teensy 4 I just got in, and none of the ADC pins are 16b. All of them are 12b.
    Indeed 12 bit - That was noted during development in the Beta T4 thread and the ref man AFAIK.

Posting Permissions

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