Flow Charts - NEC 78K0S/K 1+ Series Application Note

Sample program (16-bit timer/event counter 00) interval timer
Hide thumbs Also See for 78K0S/K 1+ Series:
Table of Contents

Advertisement

3.4

Flow Charts

The flow charts for the sample program are shown below.
<Processing after reset release>
Stopping watchdog timer
Setting the CPU clock
No
Initial settings
Setting so that an internal reset
signal is generated when
Setting the CPU clock
frequency to 8 MHz
Initializing the number of
16-bit timer/event counter 00
setting
• Setting the operation mode of
CR000 as a compare register
• Setting the interval cycle to
about 2 ms (32 s × 63)
• Setting the count clock to
f
/2
XP
• Disabling the timer output
from TO00
Starting 16-bit timer/event
counter 00 operation
(clearing & starting the timer
count upon a match between
Note Referencing the option byte is automatically performed by the microcontroller after reset release. In this
sample program, the following contents are set by referencing the option byte.
• Using the high-speed internal oscillation clock (8 MHz (TYP.)) as the system clock source
• The low-speed internal oscillator can be stopped by using software
• Using the P34/RESET pin as the RESET pin
CHAPTER 3 SOFTWARE
Reset start
Note
Referencing the option byte
Stack pointer setting
operation
frequency to 2 MHz
LVI reset
Reset source
Reset other than by LVI
= 4.3 V ±0.2 V
V
LVI
μ
200 s wait
≥ V
V
?
DD
LVI
Yes
V
< V
DD
LVI
I/O port setting
INTTM000 interrupts
μ
8
(31.25 kHz)
TM00 and CR000)
INTP1 setting
Enabling interrupt
Infinite loop
Application Note U18887EJ1V0AN
<Vector interrupt INTP1>
Vector interrupt INTP1 start
Saving the AX register data
No
Is an INTTM000 interrupt
generated?
Yes
Clearing INTTM000 interrupt
requests
INTTM000 interrupt
servicing
No
Have at least 10 ms
elapsed?
Yes
Clearing INTP1 interrupt
requests
High level
INTP1 pin level
Low level
Stopping 16-bit timer/
event counter 00 operation
Reading the interval cycle
corresponding to the number
of SW inputs
Changing the interval cycle
Starting 16-bit timer/event
counter 00 operation
(clearing & starting the timer
count upon a match between
TM00 and CR000)
Initializing the number of
INTTM000 interrupts
Restoring the AX register data
Return
<Vector interrupt INTTM000>
Vector interrupt INTTM000 start
INTTM000 interrupt
servicing
Return
<INTTM000 interrupt servicing function>
INTTM000 interrupt servicing
start
Number of interrupts < 250
Number of INTTM000
interrupts
Number of interrupts
= 250
Initializing the number of
INTTM000 interrupts
Reversing the LED output
Return
9

Advertisement

Table of Contents
loading

This manual is also suitable for:

78k0s/ka1+78k0s/kb1+78k0s/ku1+78k0s/ky1+

Table of Contents