these are my initialization of the module eTimer in the MPC5604.I want to use the module about the PWM function。but after enable the ENBL register ,the value of CNTR is not change.I do not kown how to use the module eTimer。please help me!My English is not good,forgive me。
ananan
Hi,
you need to select Primary Count Source to be Peripheral clock, e.g.
ETIMER_1.CHANNEL[4].CTRL.B.PRISRC = 0x18;
If you want to have COMPx preloaded with COMPLDx then set the CCCTRL register
/* COMP1/COMP2 register is used when the counter is counting up.
Load COMP2 with CMPLD2 upon successful compare with the value in COMP2.
Load COMP1 with CMPLD1 upon successful compare with the value in COMP1. */
ETIMER_1.CHANNEL[4].CCCTRL.R = 0xA800;
BR, Petr
thank you very much!it is work!and I have a another quiestion 。how can I control the pulse
The frequency of the PWM signal is calculated as
freq = MC_PLL_CLK / Prescaler / ( COMP1+1 + COMP2+1)
The eTimer channel's Prescaler value depends on setting CTRL[PRISRC].
BR, Petr