Rtc - Real Time Counter - Globalstar ST150 User Manual

Table of Contents

Advertisement

9150-0125-01 R-4
Invalid transitions may occur, that is when the two waveforms switch simultaneously. This may occur if the
wheel rotates too fast relative to the sample rate set for the decoder. The QDEC decodes the output from the
off-chip encoder by sampling the QDEC phase input pins (A and B) at a fixed rate as specified in the SAMPLEPER
register. If the SAMPLEPER value needs to be changed, the QDEC shall be stopped using the STOP task.
SAMPLEPER can be then changed upon receiving the STOPPED event, and QDEC can be restarted using the
START task. Failing to do so may result in unpredictable behavior.
Symbol
Tsample Time between sampling signals from quadrature decoder 128 –
Tled
Time from LED is turned on to signals are sampled
4.2.7

RTC - Real Time Counter

The Real-time counter (RTC) module provides a generic, low power timer on the low-frequency clock
source (LFCLK).
The RTC module features a 24-bit COUNTER, a 12-bit (1/X) prescaler, capture/compare registers, and a tick
event generator for low power, tickless RTOS implementation. The RTC will run off the LFCLK.
The COUNTER resolution will therefore be 30.517μs. Depending on the source, the RTC is able to run
while the HFCLK is OFF and PCLK16M is not available. The software has to explicitly start LFCLK before using
the RTC.
Counter increment frequency:
fRTC [kHz] = 32.768 / (PRESCALER + 1
The PRESCALER register is read/write when the RTC is stopped. The PRESCALER register is read-only once
the RTC is STARTed. Writing to the PRESCALER register when the RTC is started has no effect.
The PRESCALER is restarted on START, CLEAR and TRIGOVRFLW, that is, the prescaler value is latched to an
internal register (<<PRESC>>) on these tasks.
Examples:
1.
Desired COUNTER frequency 100 Hz (10 ms counter period)
PRESCALER = round(32.768 kHz / 100 Hz) - 1 = 327
fRTC = 99.9 Hz
10009.576 μs counter period
2.
Desired COUNTER frequency 8 Hz (125 ms counter period)
PRESCALER = round(32.768 kHz / 8 Hz) – 1 = 4095
fRTC = 8 Hz
125 ms counter period
ST150M User Manual
Description
Confidential & Proprietary Information
Min Typ
Max
Units
131072 usec
0
511
usec
21

Advertisement

Table of Contents
loading

This manual is also suitable for:

St150m-devkit

Table of Contents