Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Reading the 32KHz Clock Tick Count on the CYW20719

Reading the 32KHz Clock Tick Count on the CYW20719

JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

#include "rtc.h"

 

tRTC_REAL_TIME_CLOCK rtcClock1, rtcClock2;

 

rtcConfig.oscillatorFrequencykHz = 32;

rtc_init();

 

rtc_getRTCRawClock(&rtcClock1);

utilslib_delayUs(1000);

rtc_getRTCRawClock(&rtcClock2);

 

WICED_BT_TRACE("NUM TICKS ELAPSED: %d\r\n", rtcClock2.reg32map.rtc32[0] - rtcClock1.reg32map.rtc32[0]);

 

 

The tick count above is useful for providing time stamps with a high resolution. The counter goes up to 48 bits, to read more than 32, you’ll need to properly deference the higher bits.

0 Likes
1149 Views
Comments
Anonymous
Not applicable

Thanks for sharing this post...

Anonymous
Not applicable

Useful information.. highlands veterinary services