SN8P1829
8-Bit MCU build-in 12-bit ADC + PGIA + Charge-pump Reg 128 dots LCD driver
SONiX TECHNOLOGY CO., LTD
Page 47
Version 1.0
EXTERNAL RC OSCILLATOR FREQUENCY MEASUREMENT
There are two ways to get the F
OSC
frequency of external RC oscillator. One measures the XOUT output waveform.
Under external RC oscillator mode, the XOUT outputs the square waveform whose frequency is F
CPU
. The other
measures the external RC frequency by instruction cycle (F
CPU
). The external RC frequency is the F
CPU
multiplied by 4.
We can get the F
OSC
frequency of external RC from the F
CPU
frequency. The sub-routine to get F
CPU
frequency of
external oscillator is as the following.
Example: F
CPU
instruction cycle of external oscillator
B0BSET
P1M.0
; Set P1.0 to be output mode for outputting F
CPU
toggle signal.
@@:
B0BSET
P1.0
; Output F
CPU
toggle signal in low-speed clock mode.
B0BCLR
P1.0
; Measure the F
CPU
frequency by oscilloscope.
JMP
@B