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

Thread: adc->startSynchronizedSingleRead(pinLicht,ADC_INTERN AL _SOURCE::TEMP_SENSOR); -> Erro

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Location
    Germany Maintal
    Posts
    16

    adc->startSynchronizedSingleRead(pinLicht,ADC_INTERN AL _SOURCE::TEMP_SENSOR); -> Erro

    Hallo,

    i wanted mesure the chip Temperatur of my Teensy 3.6 and I found:


    adcErr = adc->startSynchronizedSingleRead(pinLicht,ADC_INTERNAL _SOURCE::TEMP_SENSOR); // produces Error : TEMP_SENSOR
    result = adc->readSynchronizedSingle(); //

    uint Temp = result.result_adc1 ;
    Serial.println(Temp,HEX);

    Temp = adc->analogRead(ADC_INTERNAL_SOURCE::TEMP_SENSOR); // no Error schows correct Result
    Serial.println(Temp,HEX);


    But I need the Syncronized SingleRead for my ISR.
    0x1A as argument produces full Scale

    Can You help ?

    Lothar

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,544
    The Teensy has 2 internal ADCs. A very sophisticated internal multiplexer allows to route several pins and signals to either the first ADC, or to the second, or (for some pins and signals) even both. And there comes the dilemma: the add->startSynchronizedSingleRead(pin1, pin2) member function requires that pin1 is available for being multiplexed to the first ADC and pin2 for the second. The temperature sensor is not available at the multiplexer for the second ADC, it can only be read by the first, thus ADC_INTERNAL_SOURCE::TEMP_SENSOR can only be used as the first function argument. pinLicht would then be the second one, but you have to take care to use a pin for your light sensor which is available at the multiplexer of the second ADC, otherwise you'll see another error.
    Last edited by Theremingenieur; 10-17-2019 at 10:15 PM.

  3. #3
    Junior Member
    Join Date
    Oct 2019
    Location
    Germany Maintal
    Posts
    16
    Thank You.
    I think this is it.
    I will try it tomorrow.
    ( in Germany we have 11pm )
    Lothar

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,544
    In France, it's also 11PM. Best time to be creative

  5. #5
    Junior Member
    Join Date
    Oct 2019
    Location
    Germany Maintal
    Posts
    16
    merci merci

  6. #6
    Junior Member
    Join Date
    Oct 2019
    Location
    Germany Maintal
    Posts
    16
    i tried with ADC0 but

    sorry Paul, there is something missing i think:

    no matching function for call to 'ADC::startSynchronizedSingleRead(ADC_INTERNAL_SOU RCE, const byte&)'


    it works with analogRead()

    can you help?

  7. #7
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,544
    The ADC library has been written by forum user Pedvide and is on GitHub. Open an issue there.

  8. #8
    Junior Member
    Join Date
    Oct 2019
    Location
    Germany Maintal
    Posts
    16
    in ADC.cpp i found:

    #elif defined(ADC_TEENSY_3_5) || defined(ADC_TEENSY_3_6)
    const uint8_t ADC::sc1a2channelADC0[]= { // new version, gives directly the pin number
    0, 68, 0, 64, 23, 14, 20, 21, 16, 17, 0, 0, 19, 18, // 0-13
    15, 22, 0, 33, 34, 0, 0, 0, // 14-21
    0, 66, 0, 0, 70, 0, 0, 0, // 22-29
    0 // 31 means disabled, but just in case
    };

  9. #9
    Junior Member
    Join Date
    Oct 2019
    Location
    Germany Maintal
    Posts
    16
    Pedvide did not answer last two years.

Posting Permissions

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