This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28075: Timer 1 - trigger interrupt ahead of time (before TIM decrements to zero)

Part Number: TMS320F28075

Hi all

I use a ISR generated by the timer1 module, which is set to a period of 200us. Assume I have to align the timer ISRs of several microcontrollers to be synchronized.

Right now I just call Timer_start(TIMER1_HWI) if the concerned timer ISR was too early, so it reloads the TIM register and restarts the timer.
But if the timer ISR is too late, repectively the ISR was not yet triggered although it should already have been triggered at the time of the synchronization (i.e. due to oscillator tolerances), I need to immediately trigger the ISR and reload the TIM register.

Right now, I can't see how to do this.

Can anyone help?

Cheers benjo

  • Hi Benjo,

    I think this timer period isn't so long that it falls outside of the range of the ePWM time base. Why not use an ePWM timer instead? These have lots of features to allow them to be synchronized either via SW or via an external pin through the ePWM sync chain.
  • Ok, thanks. I'll check the ePWM module out. Problem is, that in our 100-pin housing the ePWM modules 2-11 are already in used by other things. Maybe ePWM 1 and 12 are available internally?!

    Concerning Timer1 module - what about writung directly to the TIM register while the timer is running?

    cheers benjo

  • Hi Benjo,

    Looks like I missed your response.

    Yes, the ePWM modules are available to be used as timers even if the pins are not available.

    As far as the CPU timer, I don't see any obvious issues with just writing the TIM register in the ISR. You may want to ensure that the compiler is generating a single 32-bit write and not two separate 16-bit writes.