Page 50 of 346 Start Back Next End ZBasic System Library 38 ZBasic Microcontrollers RTC Scale Factor (RTC_SCALE) 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. RTC Fast Tick Frequency (F_RTC_FAST) 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. RTC Tick Frequency (F_RTC_TICK) 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. RTC Timer Frequency (F_RTC_TIMER) 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. TimerSpeed1 Frequency (F_TS1) 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. TimerSpeed2 Frequency (F_TS2) 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.TimerSpeed2. For generic target devices, the initial value of Register.TimerSpeed2 is implied by the configuration parameter TimerSpeed2Divisor. See the section I/O Timer Prescaler Values for information on the relationship of prescaler selector values to divisor values. It is highly recommended to use the built-in values Register.CPUFrequency, Register.RTCTickFrequency, and Register.RTCTimerFrequency in your application code instead of using hard-coded values. Doing so also simplifies code that must run on multiple devices that operate at different speeds. See the descriptions of these values in the ZBasic Language Reference Manual for more details.