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

Thread: Teensy Register File Locations

  1. #1
    Junior Member
    Join Date
    May 2020
    Posts
    8

    Teensy Register File Locations

    Hello,

    I have a teensy 4.0 and would like to play with the registers directly.
    Embarrassingly enough, i can't find the location of where they are stored on my computer. I also can't find it on google... I know this is possible since I've done this on Arduino UNO and DUE.

    I installed the teensy software and have the Arduino IDE. I was able to program the teensy 4.0 so i know that's working.
    I'm running a Windows 10 laptop.

    Can someone point me in the direction of where the register files are stored in Windows 10?

    Thanks, for all the help!

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,665
    maybe cores/teensy4/imxrt.h ?

  3. #3
    Senior Member
    Join Date
    Dec 2014
    Posts
    304
    A "register file" is generally the CPU registers, these come from the ARM cortex architecture specification.
    These are the registers where integers, floats, and pointers are manipulated by the CPU.
    The register file on ARM Cortex-M7 include registers r0-r15, as well as s0-s31 (or d0-d15, for double precision.)

    What you may be thinking about is "device/peripheral memory mapped control registers."
    These depend on which specific peripherals are built-into, or attached to the microcontroller.
    All the peripheral registers and locations are defined in the IMXRT data sheet, which you can find at https://www.pjrc.com/teensy/IMXRT1060RM_rev2.pdf

  4. #4
    Junior Member
    Join Date
    May 2020
    Posts
    8
    Hello,
    Okay, thank you. I was able to find the needed file. To help others that may also have this problem, here is the exact location:

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\im xrt.h

    Yes, I am interested in the peripheral control registers (i.e. SPI, general purpose pins, ...). Yes, the registers are defined in the datasheet, but it's always good to reference the registers in the .h file. An example is the SPI status register. It's just called "SR" in the datasheet but in the imxrt.h its actually called LPSPI1_SR or sometimes you must use pointer notation to access registers (run into that on the Arduino Due recently)...

    Anyways, I appreciate all your help. Problem solved!

Posting Permissions

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