[Example 3] The system clock (f
minimum period (2
WDTM
0
1
1
Note To use the system clock as the watchdog timer operation clock, the option byte must be used
to set to "Oscillation is stopped by software setting (LSRSTOP bit is set to 1)". For details,
refer to
The WDTM register setting value is
respectively)".
• Assembly language
MOV
• C language
WDTM = 0b01101000;
[Column] hdwinit function and main function
To create a program in C language, the hdwinit function is called to initialize peripheral devices (SFR)
immediately after CPU reset. Initial settings, such as the watchdog timer setting and clock frequency
selection are therefore basically described in the hdwinit function.
The main function is called after calling the hdwinit function, so main processing is described in the main
function.
Do not call the hdwinit function from the main function. In this case, the hdwinit function is executed twice
and the watchdog timer setting, which is only allowed to be set once is executed twice. As a result, an
internal reset signal is generated during the second execution disabling the program to advance from the
initial setting.
For details, refer to the
Programming on the NEC Electronics FAQ Web page.
16
CHAPTER 4 SETTING METHODS
) is used as the watchdog timer operation clock and the overflow time is set to the
X
13
/f
).
X
0
1
0
0
4.1 Option Byte
Setting.
WDTM,
#01101000B
CC78K0S Language User's Manual
Application Note U18752EJ2V0AN
0
Overflow time setting
13
0
0
0
2
/f
Operation clock selection
0
1
System clock (f
"01101000
(bits 7, 6, and 5 must be set to 0, 1, and 1,
and
Processing to be executed first
X
Note
)
X
under
Need help?
Do you have a question about the 78K0S/K 1+ Series and is the answer not in the manual?