Go Down

Topic: DUE temperature sensor API (Read 5 times) previous topic - next topic


Reference manual says processor has temperature sensor on ADC channel 15, what is the API for reading temperature?


I don't know for sure as I haven't got a Due yet but what happens when you try and read analogue channel 15.
Maybe there isn't one, it wouldn't surprise me because there wasn't one on the old arduino and that had a temperature sensor in it as well.


Yes, I don't have a board yet either (wrong side of the pond) -- looking at the underlying source, me thinks an analogRead(15) might work ...


Oct 25, 2012, 06:43 pm Last Edit: Oct 25, 2012, 06:46 pm by Graynomad Reason: 1
From the data sheet

AD15 is not an actual pin but is connected to a temperature sensor.


The temperature sensor is connected to Channel 15 of the ADC.
The temperature sensor provides an output voltage VT that is proportional to absolute temperature (PTAT). To activate the temperature sensor, TSON bit (ADC_ACR) needs to be set.

So analogRead(15) will only work if the TSON bit in ADC_ACR is set by the looks of it. So it's up to the Arduino guys to do that or I guess you can do it yourself.
Rob Gray aka the GRAYnomad www.robgray.com


Yes but on the normal arduino they masked out the upper part of the channel select byte so you could not access the things like the sensor, zero volts 5V and internal Vref. It would have been so much more flexible if they had not done this. You need to look at the C code for the analogue read on a Due to see what they have done this time.

Go Up