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
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