Epson S1C31W74 Technical Manual page 37

Cmos 32-bit single chip microcontroller
Table of Contents

Advertisement

2 POWER SUPPLY, RESET, AND CLOCKS
IOSC oscillation auto-trimming function
The auto-trimming function adjusts the IOSCCLK clock frequency selected using the CLGIOSC.IOSCFQ[2:0]
bits by trimming the clock with reference to the high precision OSC1CLK clock generated by the OSC1 oscil-
lator circuit. Follow the procedure shown below to enable the auto-trimming function.
1. After enabling the OSC1 oscillation, check if the stabilized clock is supplied (CLGINTF.OSC1STAIF bit =
1).
2. After enabling the IOSC oscillation, check if the stabilized clock is supplied (CLGINTF.IOSCSTAIF bit = 1).
3. Write 0x0096 to the SYSPROT.PROT[15:0] bits. (Remove system protection)
4. If the SYSCLK clock source is IOSC, set the CLGSCLK.CLKSRC[1:0] bits to a value other than 0x0
(IOSC).
5. Configure the following CLGINTF register bits:
- Write 1 to the CLGINTF.IOSCTEDIF bit.
- Write 1 to the CLGINTF.IOSCTERIF bit.
6. Configure the following CLGINTF register bits:
- Set the CLGINTE.IOSCTEDIE bit to 1.
- Set the CLGINTE.IOSCTERIE bit to 1.
7. Write 1 to the CLGIOSC.IOSCSTM bit.
8. Write a value other than 0x0096 to the SYSPROT.PROT[15:0] bits. (Set system protection)
9. The trimmed IOSCCLK can be used if the CLGINTF.IOSCTEDIF bit = 1 after an interrupt occurs. If the
CLGINTF.IOSCTERIF bit = 1, an error has occurred during the auto-trimming operation (the clock has not
been adjusted).
After the trimming operation has completed, the CLGIOSC.IOSCSTM bit automatically reverts to 0. Although
the trimming time depends on the temperature, an average of several 10 ms is required. When IOSCCLK is being
used as the system clock or a peripheral circuit clock, do not use the auto-trimming function.
OSC1 oscillation stop detection function
The oscillation stop detection function restarts the OSC1 oscillator circuit when it detects oscillation stop under
adverse environments that may stop the oscillation. Follow the procedure shown below to enable the oscillation
stop detection function.
1. After enabling the OSC1 oscillation, check if the stabilized clock is supplied (CLGINTF.OSC1STAIF bit = 1).
2. Write 1 to the CLGINTF.OSC1STPIF bit.
3. Write 1 to the CLGINTE.OSC1STPIE bit.
4. Write 0x0096 to the SYSPROT.PROT[15:0] bits. (Remove system protection)
5. Set the following CLGOSC1 register bits:
- Set the CLGOSC1.OSDRB bit to 1.
- Set the CLGOSC1.OSDEN bit to 1.
6. Write a value other than 0x0096 to the SYSPROT.PROT[15:0] bits. (Set system protection)
7. The OSC1 oscillation stops if the CLGINTF.OSC1STPIF bit = 1 after an interrupt occurs.
If the CLGOSC1.OSDRB bit = 1, the hardware restarts the OSC1 oscillator circuit.
Note: Enabling the oscillation stop detection function increase the oscillation stop detector current (I
2-12
(Clear interrupt flag)
(Clear interrupt flag)
(Enable interrupt)
(Enable interrupt)
(Enable IOSC oscillation auto-trimming)
(Clear interrupt flag)
(Enable interrupt)
(Enable OSC1 restart function)
(Enable oscillation stop detection function)
Seiko Epson Corporation
OSD1
S1C31W74 TECHNICAL MANUAL
(Rev. 1.1)
).

Advertisement

Table of Contents
loading

Table of Contents