Timer 1 (TIM1) used by Firmware?


Does the Particle Firmware for the Photon/P1 use Timer 1 (TIM1) in some way?


@shm45, I believe TIM1 is used (Channels 1 & 2) for PWM on the RX and TX pins but I’m not sure about channels 3 and 4. This applies to both the Photon and the Electron. Any reason you want to use TIM1 specifically?

The pinout diagrams in the docs give you a clue what timers are used with what pins

Thank you @peekay123 and @ScruffR. I see from the pinouts that the P1 can output PWMs using TIM1 Channel 2 on the TX pin (PA9) and using TIM1 Channel 3 on the RX pin (PA10). I have been using TIM1 Channel 1 via the Testmode pin (PA8) on the P1 for PWM output with 16-bit resolution (since TIM1 has 16-bit capability), but I am now seeing some interesting behaviour in which the pulse width is not constant.

Does the Particle Firmware use TIM1 for an internal timers or operating system functionality? Perhaps the software Timer functionality?

@shm45, I’ll have to search the source code. Software Timers are done via FreeRTOS so TIM1 is not used for that. Stay tuned…