Hello,
I discovered that the code I previously posted was from an early version of the firmware. The later version is different, presumably because of problems experienced during debugging. Only the BUZZ_ON() function is affected, and the modified code follows.
void BUZZ_ON( void){ TPM1SC = 0; // Disable TPM1 module TPM1C0V = DUTY_50; // PWM duty cycle 50% TPM1C1V = DUTY_50; // PWM duty cycle 50% TPM1SC = TPM1SCval; // Enable TPM1 module TPM1C0SC = TPM1C0SCval; // Enable TPM1 output Ch0 TPM1C1SC = TPM1C1SCval; // Enable TPM1 output Ch1}
I now recall that the channel register settings did not update unless the TPM module was first disabled. I apologise for any confusion.
Regards,
Mac