I was trying to add a simple frequency measurement to my TI_RTOS project running on EK-TM4C129. There are many discussions on this subject, most of it based on TivaWare lib and TM4C123 chip, so I'm adding my observations here. I was struggling for several hours to implement this functionality in my quite large project, mostly because the readouts were only 16bit values, so then decided to create a simple project with TI_RTOS, where once started, the timer 3A is initialized as split pair, edge time capture, generating HW interrupt on capture event (edge), storing values of the first and the second edge in an array. Once there are 8 sample pairs collected, timer is stopped and a SW interrupt function is posted to calculate an average and the measured frequency.
There is couple of tricks to it. From the datasheet it seems that the 8bit prescaler is automatically included to extend the timer to 24bits. However to include it needs to be written during the initialization using the TimerPrescaleSet library function, but the pre-load value must not be 0. The best results (least frequency errors) I got with 0xff. Obviously if we are pre-loading part of the counter with 0xff, it makes sense to count down, so the direction was changed to TIMER_CFG_A_CAP_TIME. There were discussions how to read the 24bit value, suggesting to set the TxSNAPS bit to drive it in a snapshot mode. This has shown as not true, the 24bit value is read correctly using the TimerValueGet function.
Regards,
Dalibor