AnsweredAssumed Answered

QE8 TPMxMOD update in TOF ISR?

Question asked by iansmusical on Sep 24, 2013
Latest reply on Oct 8, 2013 by iansmusical

Hi Everyone,


I am refering to design reference DRM093.PDF which uses an AW60 and have shown only the code of interest below:


void TIMER1_TOF_ISR(void) {

    byte dummy_read;


    if (ModifyFreq){

    TPM1MOD = ColorTMOD[Freq];    <---------------- defined as a word array



  dummy_read = TPM1SC;          

  TPM1SC_TOF =0; // clear TOF flag



I have created the same interrupt with the following init code for an QE8:


TPM1C2V = 0x0;

TPM1MOD = 33333 - 1;

TPM1C2SC = 0x3C; // edge PWM

TPM1SC = 0x4B; // Prescaler 8, bus clock


However, if with ModifyFreq set and ColorTMOD[Freq] containing a 16 bit value, say 5000 decimal, TPM1MOD doesn't update with the new value. I have tried writing it as two 8 bit values, high then low but TPM1MOD still doesn't update.


Does anyone have any ideas please?


Thanks very much in advance,