![]() ZBasic System Library
40
ZBasic Microcontrollers
ZBasic Device Parameters
Device Parameter
Symbol
Example
Value for ZX-24n
Main Clock Frequency
F_CPU
14.7456 MHz
RTC Scale Factor
RTC_SCALE
2
RTC Fast Tick Frequency
F_RTC_FAST
1024 Hz
RTC Tick Frequency
F_RTC_TICK
512 Hz
RTC Timer Frequency
F_RTC_TIMER
230.4 KHz
TimerSpeed1 Frequency
F_TS1
14.7456 MHz¹
TimerSpeed2 Frequency
F_TS2
1.8432 MHz²
1)
Assuming the default Register.TimerSpeed1 value of 1.
2)
Assuming the default Register.TimerSpeed2 value of 2.
This value represents the operating speed of the target CPU. In the case of generic target devices, it is
specified via the target device parameter ClockFrequency.
This value, limited to being 1 or 2, represents a scale factor for mapping RTC timer compare interrupts to
Register.RTCFastTick and Register.RTCTick updates. If RTC_SCALE is 1, Register.RTCFastTick and
Register.RTCTick change at the same rate. If RTC_SCALE is 2, Register.RTCFastTick changes at twice
the rate as Register.RTCTick.
This value represents the rate of change of Register.RTCFastTick which is updated on every RTC timer
interrupt. The rate of change is equal to RTC_SCALE times the rate of change of Register.RTCTick.
This value represents the rate of change of Register.RTCTick which is equal to the rate of change of
Register.RTCFastTick divided by RTC_SCALE.
This value represents the rate of change of the counting register of the RTC timer and its value is a
fraction of F_CPU determined by the RTC timer prescaler setting. For example, if the RTC timer
prescaler setting indicates a divide-by-64 prescaler, F_RTC_TIMER will be F_CPU / 64. For generic
target devices, the compiler computes the prescaler divisor based on the specified ClockFrequency,
RTCFrequency and RTCScale configuration parameters using the smallest available prescaler setting
given the maximum compare register value for the particular device.
This value represents the rate of change of the counting register of the I/O timer and its value is
computed by dividing F_CPU by the prescaler value selected by the value of Register.TimerSpeed1. For
generic target devices, the initial value of Register.TimerSpeed1 is implied by the configuration parameter
TimerSpeed1Divisor. See the section I/O Timer Prescaler Values for information on the relationship of
prescaler selector values to divisor values.
|