Hardware: nRF52840 custom board
Software:
SDK: nRF5_SDK_17.0.2_d674dde
Using FreeRTOS where #define configTICK_SOURCE FREERTOS_USE_RTC (Using RTC as systick)
2 UART's using libuart_async to achieve 921600 baud
RTC0: SoftDevice
RTC1: FreeRTOS Systick
RTC2: Time keeping counter (Overflow event tied to Hardware Timer 1 in counter mode for overflow count)
Timer0: SoftDevice
Timer1: Counts RTC2 overflows for time keeping purposes
Timer2: NRF_LIBUARTE_DRV_UARTE0
Timer3: NRF_LIBUARTE_DRV_UARTE1
Timer4: Not used
Hello,
From my understanding, I see that libuarte_async supports idle line detection using one of the following timers:
- Hardware Timer
- RTC
- App timer
Question 1: If a hardware timer is used for timeout (idle line detection), is the timer always running or does it only run while data is being received and then stop when a timeout occurs? My concern here is that hardware timers use the HFCLK and I wouldn't want the HFCLK running when no UART data is being received.
Question 2: How do you recommend I configure my timers for lowest power consumption?
I don't have enough free timers (RTC or HW Timer). App timer is inefficient because it always triggers a timeout event at the configured interval regardless if RX data is being received.
Question 3: Is it possible to use the same RTC for FreeRTOS Systick and system time counting? I don't see why I can't free up RTC2 by counting the overflow events of RTC1 and share RTC1 with FreeRTOS. I don't want to interfere with the functions of tickless idle and such though so I am not sure this is possible? If possible, I can then use RTC2 for UARTE0 timeout and Timer4 for UARTE1 timeout.
Thanks,
Derek