Hi,
I was trying to implement software UART for our product so I decided to use timer compare channels event connected to gpiote with interrupt. I want to toggle data line on every timer match against CC values I set earlier. It works now but the problem was when I tried to use all 6 compare channels on nrf52. In my implementation I set new values to CC registers every number of cc channels:
nrf_drv_timer_compare(&timer, (nrf_timer_cc_channel_t)0, buffer[counter++], false); nrf_drv_timer_compare(&timer, (nrf_timer_cc_channel_t)1, buffer[counter++], false); nrf_drv_timer_compare(&timer, (nrf_timer_cc_channel_t)2, buffer[counter++], false); nrf_drv_timer_compare(&timer, (nrf_timer_cc_channel_t)3, buffer[counter++], false); nrf_drv_timer_compare(&timer, (nrf_timer_cc_channel_t)4, buffer[counter++], false); nrf_drv_timer_compare(&timer, (nrf_timer_cc_channel_t)5, buffer[counter++], true);
were timer is timer instance, buffer is holding next calculated timer values when data line should be toggled and counter is well , counter.
But it looks like timer does not generate event when match CC4 or CC5. So for now I am using only 4 CC which gives me 50% more interrupts (every 4 CC match instead of every 6). I know on nrf51 there was only 4 CC. Maybe it somehow connected?
Regards,
Michal