Hello Kenneth Graakjaer:
Have you enabled the clock gate for TPM2?
This must be done before configuring any TPM2 register. The line of code would be this:
SIM_SCGC6 |= SIM_SCGC6_TPM2_MASK;
This applies to any peripheral; before accesing the registers you have to enable the clock gates.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------