OCOTP_ANA1 register does not exist?

Status
Not open for further replies.

LukasFun

Member
I want to read the temperature from the internal sensor. My Code for this is

Code:
#include <Arduino.h>

void setup() {
}

void loop() {
  Serial.println((TEMPMON_TEMPSENSE0 & 0x000FFF00) >> 8);
  delay(20);
}

This works, but in order to convert the raw value into an actual temperature, you need the values of ROOM_COUNT, HOT_COUNT and HOT_TEMP
which are to be found in the OCOTP_ANA1 register (see pages 1275 and 1276 in the manual). However, When compiling, the above code with the following statement

Code:
Serial.println(OCOTP_ANA1);

I get the error "'OCOTP_ANA1' was not declared in this scope". What's wrong?
 
The temp monitor code is in the teensy4 core file tempmon.c. The register is identified as HW_OCOTP_ANA1 in the core for the Teensy4. But all you have to do is Serial.println(tempmonGetTemp()) to get the temperature for the T4 which is the same thing as in the post referenced by @manitou.
 
Status
Not open for further replies.
Back
Top