![Hitachi H8/3152 Hardware Manual Download Page 74](http://html.mh-extra.com/html/hitachi/h8-3152/h8-3152_hardware-manual_140481074.webp)
70
5.4
Notes on Usage
1. When a SLEEP instruction is executed in the UDF interrupt routine, the sleep mode cannot be
canceled. Also when a SLEEP instruction is executed between an EWE interrupt acceptance
and an EEPMOV instruction execution, the sleep mode cannot be canceled. In sleep mode, the
WDT suspends operation. Therefore, the sleep mode will not be canceled by an EWE interrupt
or a UDF interrupt. The sleep mode can be canceled only by a low-level input to the
RES
pin.
2. Before the serial transfer routine using I/O ports is started, confirm that TCNT is not in the
neighborhood of H'00. When a UDF interrupt occurs during one frame of serial transfer, the
serial transfer timing shifts by the number of clock cycles required for the UDF interrupt
handling. The UDF interrupt response time (the interval between an interrupt acceptance and
the first instruction execution in the interrupt routine) is 14 CPU clock cycles. In the program
execution state, the number of cycles required until the current instruction execution is
completed is added.
3. Table 5.2 shows the state transitions with WDT.
Table 5.2
State Transitions with WDT
Current State
Next
Event
Normal
During
EEPMOV
Sleep
Mode
IRQ Routine
EWE Routine
UDF Routine
None
Normal
EEPMOV
Sleep
IRQ
EWE
UDF
EEPMOV
instruction
EEPMOV
—
—
EEPMOV
EEPMOV
EEPMOV
SLEEP
instruction
Sleep
—
—
Sleep *
2
Sleep *
2
Sleep *
2
IRQ
IRQ
—
Cleared
IRQ masked
IRQ masked
IRQ masked
EWE
EWE
— *
1
— *
1
EWE
Halt
Halt
UDF
UDF
— *
1
— *
1
UDF
UDF
Halt
Notes: 1. WDT suspends operation without being initialized. EWE or UDF event does not occur.
2. IRQ interrupts are masked. The sleep mode can be canceled by a low-level input to the
RES
pin.
4. The write instruction that reloads the initial value to TCNT must not be stored in the last eight
bytes (H'XFF8 to H'XFFF) of the area specified in TCWA. Otherwise, TCNT reloading may
fail.
5. The CS1 and CS0 bits in TCSR can be written to only once after reset. To set these bits, use
the MOV instruction; they cannot be set by executing the BSET instruction twice. Any bit
manipulation instruction, such as the BSET instruction, accesses the memory space in byte
units, and therefore, the MCU regards the first BSET instruction as setting these two bits
together.