![NEC 78K0S/K 1+ Series Application Note Download Page 42](http://html.mh-extra.com/html/nec/78k0s-k-1-series/78k0s-k-1-series_application-note_249252042.webp)
APPENDIX A PROGRAM LIST
Application Note U18752EJ2V0AN
42
----------------------------------------------------------------------------*/
P13 = 0b00000001;
/* Set output latches of P120-P123 as */
/*
high
*/
}
/*****************************************************************************
Main
loop
*****************************************************************************/
void main(void){
const unsigned char OUTDATA[10] = {0x03,0x05,0x07,0x07,0x07,0x07,0x07,
0x07,0x06,0x07};
/* Array of LED output pattern */
unsigned char INDATA;
/* Switch-input variable */
while(1){
INDATA = P4 & 0b00001001;
/* Valid switch-input status */
P2 = OUTDATA[INDATA];
/* Read LED output data from the table */
}
}
z
op.asm (Common to assembly language and C language versions)
;=============================================================================
;
; Option
byte
;
;=============================================================================
OPBT CSEG AT
0080H
DB 10011100B ; Option byte area
; ||||
; |||+----------- Low-speed internal oscillator can be
stopped
by
software
; |++------------ High-speed internal oscillation clock
(8MHz)
is
selected
for
system
clock
source
; +-------------- P34/RESET pin is used as RESET pin
DB 11111111B ; Protect byte area (for the self programming
;
mode)
; ||||||||
; ++++++++----------- All blocks can be written or erased
end