Freescale Semiconductor, Inc.
DIVIDE
INC
LSR
ROR
ROR
LDA
CMP
BHS
JMP
LDA
STA
RTS
RSHIFT
PRESHI2
PRESHI
PRESLO
RSHIFT
NO_SHIFT
ENDDIVIDE
DIVIDE
PRESLO
PTEMPLO
; Increase the right counter
; Right shift the high byte
; Right shift the low byte
; If the right shift counter >= NO_SHIFT
; End the shifting
; otherwise continue the shifting
ENDDIVIDE
******************************************
*
*
*
*
*
*
*
*
*
*
Timer service interrupt
Alternates the Port data and
backplane of LCD
******************************************
TIMERCMP
STA
COM
COM
COM
LDA
CMP
BNE
JSR
BSR
LDA
RTI
TEMP2
PORTC
PORTB
PORTA
START_TIME
#$FF
SKIP_TIME
CHECK_HOLD
COMPRGT
TEMP2
; Push Accumulator
; Port C = – (Port C)
; Port B = – (Port B)
; Port A = – (Port A)
; Start to count down the hold time
; if START_TIME = FF
SKIP_TIME
; Branch to subroutine compare register
; Pop Accumulator
******************************************
*
*
*
*
*
*
*
*
Check whether the hold time
of crash impact is due
******************************************
CHECK_HOLD
DEC
LDA
CMP
BNE
LDA
STA
LDA
STA
CLR
RTS
HOLD_CNT
HOLD_CNT
#$00
NOT_YET
#$00
PLMA
#$FF
HOLD_DONE
START_TIME
; Is the hold time up?
; If yes,
; stop buzzer
; Set HOLD_DONE to FF indicate that the
; hold time is up
; Stop the counting down of hold time
NOT_YET
******************************************
*
*
*
*
*
*
*
*
Subroutine reset
the timer compare register
******************************************
COMPRGT
LDA
STA
LDA
STA
ADD
STA
LDA
ADC
STA
STA
LDA
LDA
STA
RTS
TCNTHI
TEMPTCNTHI
TCNTLO
TEMPTCNTLO
#$4C
TEMPTCNTLO
TEMPTCNTHI
#$1D
TEMPTCNTHI
OCMPHI1
TSTATUS
TEMPTCNTLO
OCMPLO1
; Read Timer count register
; and store it in the RAM
; Add 1D4C H = 7500 periods
; with the current timer count
; 1 period = 2 us
; Save the next count to the register
; Clear the output compare flag
; by access the timer status register
; and then access the output compare
; register
******************************************
*
*
*
*
*
*
*
*
Determine which is the next
acceleration value to be display
******************************************
MAXVALUE
LDA
CMP
BLS
BRA
LDA
CMP
PTEMPLO
MAXACC
OLDMAX
NEWMAX1
HOLD_DONE
#$FF
; Compare the current acceleration with
; the memory, branch if it is <= maxacc
OLDMAX
; Decrease the Holdtime when
; the maximum value remain unchanged
2–74
www.motorola.com/semiconductors
Motorola Sensor Device Data
For More Information On This Product,
Go to: www.freescale.com