Converting Operations And Control Procedure - Epson Arm S1C31 Series Technical Manual

Cmos 32-bit single chip microcontroller
Table of Contents

Advertisement

Connecting the reference element and sensor with the same resistance will result in <Initial value: n> = <Coun-
ter value at the end of sensor oscillation: m> (if error = 0). Setting a large <Initial value: n> increases the reso-
lution of measurement. However, the measurement counter may overflow during sensor oscillation when the
sensor value decreases below the reference element value (the measurement will be canceled). The initial value
for the measurement counter should be determined taking the range of sensor value into consideration.
The time base counter should be set to 0x000000 before starting reference oscillation.
Counter value read
The measurement and time base counters operate on RFCCLK and TCCLK, respectively. Therefore, to read
correctly by the CPU while the counter is running, read the counter value twice or more and check to see if the
same value is read.

21.4.4 Converting Operations and Control Procedure

An R/F conversion procedure and the RFC operations are shown below. Although the following descriptions as-
sume that the internal oscillation circuit is used, external clock input mode can be controlled with the same proce-
dure.
R/F control procedure
1. Set the initial value (0x000000 - n) to the RFC_nMCH and RFC_nMCL registers (measurement counter).
2. Clear the RFC_nTCH and RFC_nTCL registers (time base counter) to 0x000000.
3. Clear both the RFC_nINTF.EREFIF and RFC_nINTF.OVTCIF bits by writing 1.
4. Set the RFC_nTRG.SREF bit to 1 to start reference oscillation.
5. Wait for an RFC interrupt.
i. If the RFC_nINTF.EREFIF bit = 1 (reference oscillation completion), clear the RFC_nINTF.EREFIF bit
and then go to Step 6.
ii. If the RFC_nINTF.OVTCIF bit = 1 (time base counter overflow error), clear the RFC_nINTF.OVTCIF bit
and terminate measurement as an error or retry after altering the measurement counter initial value.
6. Clear the RFC_nINTF.ESENAIF, RFC_nINTF.ESENBIF, and RFC_nINTF.OVMCIF bits by writing 1.
7. Set the RFC_nTRG.SSENA bit (sensor A) or the RFC_nTRG.SSENB bit (sensor B) corresponding to the sen-
sor to be measured to 1 to start sensor oscillation (use the RFC_nTRG.SSENA bit in AC oscillation mode).
8. Wait for an RFC interrupt.
i. If the RFC_nINTF.ESENAIF bit = 1 (sensor A oscillation completion) or the RFC_nINTF.ESENBIF bit = 1
(sensor B oscillation completion), clear the RFC_nINTF.ESENAIF or RFC_nINTF.ESENBIF bit and then
go to Step 9.
ii. If the RFC_nINTF.OVMCIF bit = 1 (measurement counter overflow error), clear the RFC_nINTF.OVMCIF
bit and terminate measurement as an error or retry after altering the measurement counter initial value.
9. Read the RFC_nMCH and RFC_nMCL registers (measurement counter) and correct the results depending on
the sensor to obtain the detected value.
R/F converting operations
Reference oscillation
When the RFC_nTRG.SREF bit is set to 1 in Step 4 of the conversion procedure above, the RFC Ch.n
starts CR oscillation using the reference resistor. 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 TC-
CLK from 0x000000.
When the measurement counter or the time base counter overflows (0xffffff → 0x000000), the RFC_nTRG.
SREF bit is cleared to 0 and the reference oscillation stops automatically.
The measurement counter overflow sets the RFC_nINTF.EREFIF bit to 1 indicating that the reference os-
cillation has been terminated normally. If the RFC_nINTE.EREFIE bit = 1, a reference oscillation comple-
tion interrupt request occurs at this point.
S1C31D41 TECHNICAL MANUAL
(Rev. 1.1)
Seiko Epson Corporation
21 R/F CONVERTER (RFC)
21-5

Advertisement

Table of Contents
loading

This manual is also suitable for:

Arm s1c31d41

Table of Contents