This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use multiple timers

I have a device that I need to control, that needs 2 different square wave signals of different frequencies (although they may be multiples of each other), one at around 4 MHz and one at 10 KHz. Additionally (while the other two are running in the background) I need to communicate to the device with SPI upon an interrupt on a separate pin. To make matters worse, I will also need the SoftDevice for communications via BLE.

I have read that the nRF51822 only comes with 3 timers (one of which is reserved for th SoftDevice). Is there still a way to use one timer for multiple tasks?

Parents
  • Hi,

    Yes, the nRF51 has 3 timers and the Softdevice needs one of them. So then you have two left for you application. The nRF51 also has two RTC timers, and once again the Softdevice seizes one of them. Maybe you can use the other one for your low frequency square wave? I suppose you can also use PPI and GPIOTE with your timers to make the square waves operate without involving interrupts and the CPU. Then it shouldn't be a problem to do both SPI and BLE as well.

Reply
  • Hi,

    Yes, the nRF51 has 3 timers and the Softdevice needs one of them. So then you have two left for you application. The nRF51 also has two RTC timers, and once again the Softdevice seizes one of them. Maybe you can use the other one for your low frequency square wave? I suppose you can also use PPI and GPIOTE with your timers to make the square waves operate without involving interrupts and the CPU. Then it shouldn't be a problem to do both SPI and BLE as well.

Children
Related