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

Status
Not open for further replies.

Wibbing

Member
adc->startSynchronizedSingleRead(pinLicht,ADC_INTERNAL _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
 
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:
i tried with ADC0 but

sorry Paul, there is something missing i think:

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


it works with analogRead()

can you help?
 
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
};
 
Status
Not open for further replies.
Back
Top