20 Temperature Detection Circuit (TEM)
20-2
Seiko epson Corporation
S1C17F13 TeChniCal Manual
(Rev. 1.0)
Clock Settings
20.2
TEM Operating Clock
20.2.1
When using TEM, the TEM operating clock CLK_TEM must be supplied to TEM from the clock generator. The
CLK_TEM supply should be controlled as in the procedure shown below.
1. Enable the clock source in the clock generator if it is stopped (refer to “Clock Generator” in the “Power Supply,
Reset, and Clocks” chapter).
2. Set the following TEMCLK register bits:
- TEMCLK.CLKSRC[1:0] bits (Clock source selection)
- TEMCLK.CLKDIV[1:0] bits (Clock division ratio selection = Clock frequency setting)
Clock Supply in SLEEP Mode
20.2.2
When using TEM during SLEEP mode, the TEM operating clock CLK_TEM must be configured so that it will
keep supplying by writing 0 to the CLGOSC.
xxxx
SLPC bit for the CLK_TEM clock source.
Clock Supply in DEBUG Mode
20.2.3
The CLK_TEM supply during DEBUG mode should be controlled using the TEMCLK.DBRUN bit.
The CLK_TEM supply to TEM is suspended when the CPU enters DEBUG mode if the TEMCLK.DBRUN bit =
0. After the CPU returns to normal mode, the CLK_TEM supply resumes. Although TEM stops operating when the
CLK_TEM supply is suspended, the registers retain the status before DEBUG mode was entered. If the TEMCLK.
DBRUN bit = 1, the CLK_TEM supply is not suspended and TEM will keep operating in DEBUG mode.
Operations
20.3
Initialization
20.3.1
TEM should be initialized with the procedure shown below.
1. Set the TEMCLK.CLKSRC[1:0] and TEMCLK.CLKDIV[1:0] bits. (Configure operating clock)
2. Set the TEMTMG.CVTM[7:0] bits.
(Set comparison time)
3. Set the following bits when using the interrupt:
- Write 1 to the TEMINTF.TEMIF bit.
(Clear interrupt flag)
- Set the TEMINTE.TEMIE bit to 1.
(Enable interrupt)
Comparison Time Setting
20.3.2
Set the time for comparing each comparison voltage by the comparator to the TEMTMG.CVTM[7:0] bits.
Be sure to set a 150 µs or more comparison time including clock frequency dispersion.
CVTM + 1
Comparison time = ——————
≥
150 [µs]
(Eq. 20.1)
CLK_TEM
Where
CVTM:
TEMTMG.CVTM[7:0] bit setting value (0 to 255)
CLK_TEM: CLK_TEM frequency [Hz]