TPM in Edge-aligned PWM Mode: Starting Duty Cycle

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

TPM in Edge-aligned PWM Mode: Starting Duty Cycle

1,157 次查看
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

 


标签 (1)
0 项奖励
回复
1 回复

680 次查看
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 项奖励
回复