TPM in Edge-aligned PWM Mode: Starting Duty Cycle

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

TPM in Edge-aligned PWM Mode: Starting Duty Cycle

718 Views
Harman
Contributor II

Hello,

 

after setup TPM as Enge-aligned PWM generator to 100% duty cycle

 

 

// Edge-aligned PWM    TPM1C0SC = 0b00101000;  // Timer1 Ch0 configuration    TPM1C1SC = 0b00101000;  // Timer1 Ch1 configuration//               ||||||||//               ||||||++-- 00 (unused)//               |||||+---- ELSnA//               ||||+----- ELSnB//               |||+------ MSnA
//               ||+------- MSnB
//               |+-------- CHnIE (Chx int enable) 0=disable, 1=enable//               +--------- CHnF (Chx int flag)    TPM1MOD = MODULO_TPMVALUE_10MS;    // Value    TPM1C0V = MODULO_TPMVALUE_10MS+1;    TPM1C1V = MODULO_TPMVALUE_10MS+1;    TPM1SC = 0b00001100;//             ||||||||   //             |||||||+-- PS0 [PS2:PS1:PS0]://             ||||||+--- PS1 000=/1, 001=/2, 010=/4, 011=/8//             |||||+---- PS2 100=/16, 101=/32, 110=/64, 111=/128//             ||||+----- CLKSA
//             |||+------ CLKSB
//             ||+------- CPWMS
//             |+-------- TOIE (TOF int enable) 0=disable, 1=enable//             +--------- TOF (Timer overflow flag)

 

 

TPM generates one period with 0% duty cycle. Is it possible to supress this behaviour? I need to start with 100 % duty cycle.

 

Thanks a lot.

Jan

 


Labels (1)
0 Kudos
1 Reply

241 Views
bigmac
Specialist III

Hello Jan,

 

You might try writing to TPM1CnSC after you have already written to TPM1CnV register.  If this does not work, maybe you could try setting up for low-true output pulses, with an initial duty cycle of zero.

 

Regards,

Mac

 

0 Kudos