COP8SA-DM National Semiconductor, COP8SA-DM Datasheet - Page 207

no-image

COP8SA-DM

Manufacturer Part Number
COP8SA-DM
Description
MODULE DEBUGGING FOR COP8SA
Manufacturer
National Semiconductor
Datasheet

Specifications of COP8SA-DM

Module/board Type
Debugger Module
For Use With/related Products
Cop 8
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
*COP8SA-DM
SELF:
T1SERV:
UNDFLW:
ERROR:
.ADDRW
.ADDRW
.ENDSECT
4.4.5
This mode of operation is very similar to the PWM Mode of operation. The only difference
is that the timer is clocked from an external source. This mode provides the ability to
perform control of a system based on counting a predetermined number of external
events, such as searching for the nth sector on a disk or testing every nth part on an
assembly line. The code for this example is provided below.
SELF:
External Event Counter Example
.INCLD
.SECT
LD
LD
LD
LD
LD
LD
LD
JP
.SECT
VIS
IFBIT
JP
RBIT
.
.
RETI
RBIT
.
RETI
RETI
.SECT
ERROR
...
T1SERV
...
.INCLD
.SECT
RBIT
RBIT
LD
LD
LD
LD
LD
LD
LD
LD
SBIT
LD
JP
COP888XX.INC
TMR, ROM
PORTGC,#00
PORTGD,#08
TMR1L0,#0FF
TMR1HI,#0FF
ICNTRL,#00
CNTRL,#0C0
PSW,#011
SELF
INTERRUPT,ROM, ABS=0FF
T1C0,CNTRL
UNDFLW
T1PNDA,PSW
T1C0,CNTRL
INTTABLE, ROM, ABS=01E0
COP888XX.INC
EEC, ROM
3,PORTGC
3,PORTGD
CNTRL,#00
ICNTRL,#00
TMR1LO,#COUNT0
TMR1HI,#COUNT1
T1RALO,#Count0
T1RAHI,#Count1
T1RBLO,#Count0
T1RBHI,#Count1
T1C0,CNTRL
PSW,#011
SELF
;TIMER T1 CONFIGURATION
;Configure G3/T1A as input
;Weak pull-up on G3
;Timer lower byte initialization
;Timer upper byte initialization
;Disable T1B interrupt
;Timer capture mode, positive edge on T1A
;Enable T1A and global interrupts
;Wait for capture
;Set location counter to 00FF Hex
;Vector to appropriate interrupt routine
;TIMER SERVICE ROUTINE
;If T1 underflow
;then handle timer underflow
;else Reset T1PNDA pending flag
;(Process Timer Capture)
;(Process Timer Capture)
;Return from interrupt
;Reset timer underflow pending flag
;(Process Timer Underflow)
;Return from interrupt
;ERROR ROUTINE (NO INTERRUPT PENDING)
;Return from interrupt
;Set location counter to 01E0 Hex
;Store Error routine vector address
;{Store vector addresses 01E2 - 01F5 Hex}
;Set location counter to 01F6 Hex
;Store T1PNDA routine vector address
;{Store vector addresses 01F8 - 01FF Hex}
;TIMER T1 CONFIGURATION
;Configure G3/T1A as Hi-Z input
;
;Select timer T1 as external event counter
;Disable T1B interrupt
;Timer T1 lower byte
;Timer T1 upper byte
;Initialize Auto-reload R1A lower byte
;Initialize Auto-reload R1A upper byte
;Initialize Auto-reload R1B lower byte
;Initialize Auto-reload R1B upper byte
;Start timer
;Enable timer T1A and global interrupts
;Wait for the n-th count
;TIMER INTERRUPT HANDLING ROUTINE
;VECTOR TABLE
COP8SAx7 APPLICATION IDEAS
4-15

Related parts for COP8SA-DM