21 of 286
7 I/O Timer Pre-scaler Values Some of the System Library routines that use a timer allow you to modify the frequency used to clock the timer while others use a fixed frequency determined by the requirements of the routine. The routines that do allow frequency modification are divided into two groups, one controlled by the value of Register.TimerSpeed1 and the other controlled by the value of Register.TimerSpeed2. The table below shows the System Library routines that use a timer and, where applicable, the timer speed variable that controls the timer frequency. System Library Routines Using TimerSpeed Values Routine TimerSpeed Value ADCtoCom1() Com1toDAC() CountTransitions() TimerSpeed1¹ FreqOut() Get1Wire() Get1WireByte() Get1WireData() I2CCmd()² TimerSpeed1 I2CGetByte()² TimerSpeed1 I2CPutByte()² TimerSpeed1 InputCapture() TimerSpeed1 InputCaptureEx() TimerSpeed1 OutputCapture() TimerSpeed1 OutputCaptureEx() TimerSpeed1 OpenPWM() RCTime() TimerSpeed2¹ PlaySound() PulseIn() TimerSpeed2¹ PulseOut() TimerSpeed2¹ Put1Wire() Put1WireByte() Put1WireData() PWM() Reset1Wire() ShiftIn() TimerSpeed1 ShiftInEx() TimerSpeed1 ShiftOut() TimerSpeed1 ShiftOutEx() TimerSpeed1 X10Cmd() Notes: 1) The timer frequency is scaled. See below. 2) The timer is used only for channels 1-4. The default value of Register.TimerSpeed1 is 1 and the default value for Register.TimerSpeed2 is 2. The table below shows the correspondence between the allowable values for the TimerSpeed registers and the resulting clock frequency applied to the I/O Timer. The divisor specified is applied to the CPU clock frequency to yield the I/O Timer clock frequency. For compatibility with BasicX (but only for ZX processors running at 14.7456MHz), some of the routines effectively divide the timer frequency by 2 so that the time units associated with parameters or return values is preserved. If you change the timer speed setting, the scale factor is still applied.