AN1836 Motorola / Freescale Semiconductor, AN1836 Datasheet - Page 14

no-image

AN1836

Manufacturer Part Number
AN1836
Description
FLASH Programming for Motorola MC68HC912 Microcontrollers
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
Application Note
;-----------------------------------------------------------------------
;----------------------
;-----------------------------------------------------------------------
dly_500ms:
;-----------------------------------------------------------------------
;---
;---
;---
;---
;-----------------------------------------------------------------------
DelaymS:
DlyLoop1mS:
DlyLoop:
;-----------------------------------------------------------------------
;---
;---
;---
;---
;---
;-----------------------------------------------------------------------
dly_22us:
d_22u:
dly_10us:
d_10u:
DATA
14
To reduce loop overhead, the following routines have been
optimized by counting cycle time and calculating the delay
based on an 8MHz system clock.
Call with the number of ms to delay in the D accumulator.
The delay is not exact, but close enough when delaying ms.
Microsecond Delay Routines
Millisecond Delay Routine
LDD
BSR
RTS
LDX
NOP
DBNE
DBNE
RTS
LDD
DBNE
RTS
LDD
DBNE
RTS
FCB
FCB
END
Delay Subroutines
#500
DelaymS
#mS1Delay
X,DlyLoop
D,DlyLoop1mS
#52
D,d_22u
#24
D,d_10u
"Motorola Microcontrollers"
$00
(8MHz e clock)
;Delay for 500 ms
;Load 1ms delay count into X
;Decrement count
;Loop until done.
; Delay for about 22-23us
; JSR or BSR is 4 cycles
; Total delay is {4+2+(loopcount*3)+5}*125ns
; For a loopcount of 52 yields 20.875us
; -2 cycles-
; -3 cycles-
; -5 cycles-
; Delay for about 10us
; JSR or BSR is 4 cycles
; Total delay is {4+2+(loopcount*3)+5}*125ns
; For a loopcount of 24 yields 10.375us
; -2 cycles-
; -3 cycles-
; -5 cycles-
-----------------------
---
---
---
---
---
---
---
---
---
MOTOROLA
AN1836

Related parts for AN1836