Epson S1C17624 Technical Manual page 280

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

25 R/F COnVeRTeR (RFC)
25.6.2
Reference Oscillation Control
First, perform oscillation with the reference resistor/capacitor and obtain the time base counter value to perform
sensor oscillation for the same period of time.
(1)
Set the initial value (0x0 - n) to MC[23:0]/RFC_MC(H/L) registers (measurement counter). (See Section 25.5.)
(2)
Set 0x0 to TC[23:0]/RFC_TC(H/L) registers (time base counter).
(3)
Reset the cause-of-interrupt flags OVTCIF and EREFIF in the RFC_IFLG register by writing 1.
(4)
Set SREF/RFC_TRG register to 1 to start reference oscillation.
The CR oscillator circuit starts oscillating with the reference resistor/capacitor and outputs the clock to the
measurement counter. The measurement counter starts counting up using the CR oscillation clock from the
initial value that has been set. The time base counter starts counting up using TCCLK from 0x0.
notes: • In the S1C17602/621, after a value is set to TC[23:0], wait a time interval at least three TCCLK
cycles before starting oscillation.
• For restrictions and precautions on control bit settings, see the descriptions in the "Control
Register Details" section. The control bits may not be set to the desired values depending on
conditions.
(5) When the measurement counter or the time base counter overflows (0xffffff → 0x0), SREF is reset to 0 and
the reference oscillation stops automatically.
(6-1) The measurement counter overflow sets EREFIF to 1 indicating that the reference oscillation has been termi-
nated normally. An interrupt can be generated at this point. Read the time base counter value (TC[23:0] = X)
and store it to the memory by the interrupt handler routine. When this interrupt is not used, perform the same
processing after checking if EREFIF has been set.
(6-2) The time base counter overflow sets OVTCIF to 1 indicating that the reference oscillation has been terminat-
ed abnormally. An interrupt can be generated at this point. Handle this error in the interrupt handler routine.
When this interrupt is not used, perform the same processing after checking if OVTCIF has been set.
Count value Max.
(0xffffff)
two's-complement
Measurement counter
(set via software)
Count (0x0 - n)
Count value Min.
(0x0)
Count value Max.
(0xffffff)
Time base counter
(set via software)
Count value Min.
(0x0)
Start of reference oscillation
Figure 25.
25.6.3
Sensor Oscillation Control
Perform oscillation with the sensor for the period of time obtained by the time base counter in reference oscillation
and count the oscillation clock by the measurement counter.
25-6
Count n
Count Up
of value n
Overflow
(abnormal termination)
OVTCIF = 1, SREF = 0
Count Up
0x0
Reference oscillation
period t
REF
SREF = 0 → 1
6.2.1 Counter Operations During Reference/Sensor Oscillation
Seiko epson Corporation
Overflow
(normal termination)
(abnormal termination)
EREFIF = 1, SREF = 0
OVMCIF = 1, SSENx = 0
Count Up
0x0
(set automatically by reference oscillation
or set via software)
(set automatically by reference oscillation
or set via software)
Count Down
Sensor oscillation
period t
(= t
SEN
Start of sensor oscillation
SSENx = 0 → 1
S1C17624/604/622/602/621 TeChniCal Manual
Overflow
Count value m1
Varied depending
on environment
Count value m2
Determine the value
detected by the sensor
using the measurement
counter values m1 and m2.
Underflow
(normal termination)
ESENxIF = 1, SSENx = 0
)
REF
Time

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17604S1c17622S1c17602S1c17621

Table of Contents