Pulse width measurement and time measurement

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

cross mob
Anonymous
Not applicable


Per this original thread that is now closed: Re: Pulse width measurement and time measurement

boont wrote:

This thread explained a little on the use of rtc_getRTCRawClock.

Resetting RTC internal counter

I didn't see any reference to this function in that thread... can anyone elaborate on the value returned by this function?  Is the 48-bit clock counting ticks based on the 32kHz LPO (ie ~31us per tick)?

0 Likes
1 Solution

If you configured and used an external 32K xtal (like the rtc_sample app does), then yes, RTC counts up this 32K rising edges. If you use the internal LPO instead (which is the default), then it counts the internal 128KHz LPO rising edges.

View solution in original post

0 Likes
4 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

I was checking the API within the SDK and found the below:

void rtc_getRTCRawClock (tRTC_REAL_TIME_CLOCK * rtcClock)

Reads current RTC value from hardware clock.

Parameters
rtcClockPointer to allocated RTC time structure into which the current time is to be copied into.

Is the above useful to you?

The requester in "Resetting RTC internal counter" has made some errors in his code, that's why.

What is the issue you are facing?

0 Likes
Anonymous
Not applicable

Quite simply I'd like further clarification as to what is the hardware that generates this value read back from rtc_getRTCRawClock.  Is it simply a 48-bit counter that increments every rising edge of the 32kHz clock? 

0 Likes

rtc_getRTCRawClock will read back the raw 48-bit clock although I'm not sure of the mechanics of it.

0 Likes

If you configured and used an external 32K xtal (like the rtc_sample app does), then yes, RTC counts up this 32K rising edges. If you use the internal LPO instead (which is the default), then it counts the internal 128KHz LPO rising edges.

0 Likes