Direct register access using address

Status
Not open for further replies.

ossi

Well-known member
On the Teensy 3.6 the register CMT_PPS has the address 0x4006200A according to the datasheet. How can I access the CMT_PPS register using this address?
 
On the Teensy 3.6 the register CMT_PPS has the address 0x4006200A according to the datasheet. How can I access the CMT_PPS register using this address?
for T3* boards most register symbols are defined in hardware/teensy/avr/cores/teensy3/kinetis.h
Code:
#define CMT_PPS			(*(volatile uint8_t  *)0x4006200A) // CMT Primary Prescaler Register
so all you have to do is reference it in your sketch, e.g. Serial.println(CMT_PPS,HEX);

For Teensy 4, see hardware/teensy/avr/cores/teensy4/imxrt.h
 
@vjmuzik: Your link was of great help! I did not read/write the registers with the right size (32,16,8 bit). Now it works.
@manitou: I know that I can use the names for the periperals, but I wanted to access them without using names. Thanks for the hints to the place where the constants are defined.

Thanks to all those people at this forum helping a beginner!
 
Status
Not open for further replies.
Back
Top