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

Thread: OCOTP_ANA1 register does not exist?

Hybrid View

  1. #1
    Junior Member
    Join Date
    Oct 2019

    OCOTP_ANA1 register does not exist?

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

    #include <Arduino.h>
    void setup() {
    void loop() {
      Serial.println((TEMPMON_TEMPSENSE0 & 0x000FFF00) >> 8);
    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

    I get the error "'OCOTP_ANA1' was not declared in this scope". What's wrong?

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    and you can look in the core source files to see how tempmonGetTemp() does it

  3. #3
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    New York
    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.

Posting Permissions

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