How to use the Frequency Meter in the MPC5645S?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use the Frequency Meter in the MPC5645S?

1,224 Views
janos_murai
Contributor III

Hello all,

I would like to measure the frequency of the SXOSC. For this, I would like to use the CMU (Clock Monitor Unit). 

My problem is that I cannot write to the appropriate registers. 

- The processor is in DRUN mode.

- There is no active write protection for the CMU registers. 

- The system clock is the FXOSC. 

- FXOSC, SXOSC are enabled. 

Any idea what could cause the problem?

Thank you!

János Murai

7 Replies

889 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Are you executing in supervisor mode?

0 Kudos

889 Views
janos_murai
Contributor III

Yes, the MCU is in supervisor mode (the MSR.PR bit is zero). 

In RUN0 mode: I can't modify the registers, always the reset values are present. 

In DRUN mode: If I write anything to the CMU.CSR register it becomes zero. 

János

0 Kudos

889 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

What is your compiler? Have you tried to see the register over memory dump window?

889 Views
janos_murai
Contributor III

The compiler: 

pastedImage_1.png

The memory dump:

pastedImage_2.png

These are the values that I can read back in C. These are the reset values, as noted in the RM.

Although, there might be something with the debugger, because if I press step over, the values change kind of randomly, while I can see in the disassembly that non register writing instructions are executing... 

0 Kudos

889 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Currently we don't have any working evaluation board with MPC5645S. We have ordered one and when it arrives (probably next week) I will try it. For now I am short of ideas. Do you see this behavior only with CMU registers?

889 Views
janos_murai
Contributor III

davidtosenovjan ,

could you figure out something? 

I just realized that I have a very similar issue with the MPU (Memory Protection Unit). All the MPU registers are writable except the CESR.VLD. So I have a feeling that it should be something with the privileges...

0 Kudos

889 Views
janos_murai
Contributor III

Thank you David!

 

All the other registers that I use can be modified without any problem. So I don't face this behavior anywhere else...

0 Kudos