Intel 8XC196NT User Manual page 407

Table of Contents

Advertisement

8XC196NT USER'S MANUAL
The calling routine must pass two parameters to this routine — the data to be programmed (in
DATA_TEMP) and the address (in ADDR_TEMP).
PROGRAM:
PUSHA
LD
WSR,#7BH
LD
COUNT,#5
ANDB INT_PEND,#CLEAR_EPA0
LDB
INT_MASK,#ENABLE_EPA0
LDB
EPA0_CON,#EPA0_TIMER
LOOP:
LD
TEMP0,TIMER1
ADD
EPA0_TIME,TEMP0,#PGM_PULSE
EI
ST
DATA_TEMP,[ADDR_TEMP]
IDLPD #1
DJNZ COUNT,LOOP
POPA
RET
EPA0_ISR:
RET
Figure 15-15. Run-time Programming Code Example
15-44
;clear PSW, WSR, INT_MASK, INT_MASK1
;select 32-byte window with EPA0_CON
;set up for 5 programming cycles
;clear EPA0 pending bit
;enable EPA0 interrupt
;set up EPA0 as software timer
;load TIMER1 value into TEMP0
;load EPA0_TIME with TIMER1 + PGM_PULSE
;enable unmasked interrupt(EPA0)
;store passed data at passed address
;enter idle mode
;decrement COUNT and loop if not 0
;to complete 5 programming cycles
;restore PSW, WSR, and INT_MASKs

Advertisement

Table of Contents
loading

Table of Contents