
; A complete 8520 timing example. This blinks the power light at (exactly)
; 3 millisecond intervals. It takes over the machine, 50 watch out!
;
; The base Amiga crystal frequencies are:
; NTSC 28.63636 MHz
; PAL 28.37516 MHz
;
; The two 16 bit timers on the 8520 chips each count down at 1/10 the CPU
; clock, or 0.715909 MHz. That works out to 1.3968255 microseconds per
count.
; Under PAL the countdown is slightly slower, 0.709379 MHz.
;
; To wait 1/100 second would require waiting 10,000 microseconds.
; The timer register would be set to (10,000 / 1.3968255 - 7159).
;
; To wait 3 milliseconds would require waiting 3000 microseconds.
; The register would be set to (3000 / 1.3968255 - 2148).
INCLUDE "hardware/cia.i"
INCLUDE "hardware/custom.i"
;
XREF _ciaa
XREF _ciab
XREF _custom
;
lea _custom,a3 ; Base of custom chips
lea _ciaa,a4 ; Get base address if CIA-A
;
move.w S7fff,dmacon(a3) ; Kill all chip interrupts
;
; Setup, only do once
; This set all bits needed for timer A one-shot mode.
;
move.b ciacra(a4),d0 ;Set control register A on CIAA
and.b #%11000000,d0 ;Don't trash bits we are not
or.b #%00001000,d0 ;using...
move.b d0,ciacra(a4)
move.b #%01111111,ciaicr(a4) ;Clear all 8520 interrupts
;
Set time (low byte THEN high byte)
And the low order with $ff
Shift the high order by 8
;
TIME equ 2148
move.b (TIME&$FF),ciatalo(a4)
move.b (TIME>>8),ciatahi(a4)
;
; Wait for the timer to count down
busy_wait:
;
btst.b #0,ciaicr(a4) ;Wait for timer expired flag
beq.s busy wait
bchg.b #CIAB LED,ciapra(a4) ;Blink light
bset.b #0,ciacra(a4) ;Restart timer
bra.s busy_wait
END
- Appendix F 331 -
Summary of Contents for Amiga A1000
Page 1: ...AMIGA HARDWARE REFERENCE MANUAL 1992 Commodore Business Machines Amiga 1200 PAL...
Page 20: ...Figure 1 1 Block Diagram for the Amiga Computer Family Introduction 11...
Page 21: ...12 Introduction...
Page 72: ...Figure 3 12 A dual Playfield display Playfield Hardware 63...
Page 87: ...Figure 3 24 Horizontal Scrolling 78 playfield hardware...
Page 101: ...92 Playfield Hardware...
Page 199: ...Figure 6 9 DMA time slot allocation 190 Blitter hardware...
Page 203: ...Figure 6 13 Blitter Block Diagram 194 Blitter Hardware...
Page 229: ...220 System Control Hardware...
Page 246: ...Figure 8 8 Chinon Timing diagram cont Interface Hardware 237...
Page 265: ...256 Interface Hardware...
Page 289: ...280 Appendix A...
Page 297: ...288 Appendix B...
Page 298: ...APPENDIX C CUSTOM CHIP PIN ALLOCATION LIST NOTE Means an active low signal Appendix C 289...
Page 302: ...APPENDIX D SYSTEM MEMORY MAP Appendix D 293...
Page 343: ...334 Appendix F...
Page 351: ...342 Appendix G...
Page 361: ...352 Appendix H...
Page 367: ...358 Appendix I...