SPI example + timer, not working timer. nRF5_SDK_17.1.0

nRF5_SDK_17.1.0
Segger SES

Hi,
I added a timer to the SPI example, just a copy of the code from the timer example, the timer interrupt occurs only once and does not work further.
Please help me make this work.

spi_experiment.zip

Parents
  • Hi 

    One potential issue with the code is that you don't set the bit width of the timer. By default this will be set to 16-bits, and if the timer is set to the default prescaler of 4 (1MHz timer freq) then you won't be able to reach 100ms with a 16-bit timer. 

    The odd thing is that in this case the interrupt should never occur, so it doesn't quite match your symptoms. 

    Still could you try to specify the bit width to 32-bits and see if it works better?

    Best regards
    Torbjørn

Reply
  • Hi 

    One potential issue with the code is that you don't set the bit width of the timer. By default this will be set to 16-bits, and if the timer is set to the default prescaler of 4 (1MHz timer freq) then you won't be able to reach 100ms with a 16-bit timer. 

    The odd thing is that in this case the interrupt should never occur, so it doesn't quite match your symptoms. 

    Still could you try to specify the bit width to 32-bits and see if it works better?

    Best regards
    Torbjørn

Children
Related