Appendix A Program List - NEC 78K0S/K 1+ Series Application Note

External event counter
Hide thumbs Also See for 78K0S/K 1+ Series:
Table of Contents

Advertisement

As a program list example, the 78K0S/KB1+ microcontroller source program is shown below.
main.asm (Assembly language version)
;***************************************************************************
;
;
NEC Electronics
;
;***************************************************************************
;
78K0S/KB1+
;***************************************************************************
;
16-bit timer 00 (external event counter)
;***************************************************************************
;<<History>>
;
2007.7.--
;***************************************************************************
;
;<<Overview>>
;
;This sample program presents an example of using the external event counter
;function of 16-bit timer 00.
;interrupt every 10 times the falling edge of the external clock pulse input
;to the TI000 pin is counted.
;
;
;
<Principal setting contents>
;
;
- Stop the watchdog timer operation
;
- Set the low-voltage detection voltage (VLVI) to 4.3 V +-0.2 V
;
- Generate an internal reset signal (low-voltage detector) when VDD <
VLVI after VDD >= VLVI
;
- Set the CPU clock to 8 MHz
;
- Set the clock supplied to the peripheral hardware to 8 MHz
;
;
;
<16-bit timer 00 settings>
;
- Operation mode: Clear & start the timer count upon a match between TM00
and CR000
;
- Not performing timer output
;
- Setting the count clock to the falling edge of the TI000 pin
;
- Setting the counter compare value to 10
;
;
;<<I/O port settings>>
;

APPENDIX A PROGRAM LIST

78K0S/KB1+
Sample program
Release
The LED output is reversed by generating an
Application Note U18888EJ1V0AN
27

Advertisement

Table of Contents
loading

This manual is also suitable for:

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

Table of Contents