![Digi Rabbit 5000 Скачать руководство пользователя страница 208](http://html1.mh-extra.com/html/digi/rabbit-5000/rabbit-5000_user-manual_2496192208.webp)
208
Rabbit 5000 Microprocessor User’s Manual
19.3.3 Master/Slave Communication
1. The master writes data to the appropriate external I/O address on the data bus for the
slave device and register desired. For example, in the setup described here, the master
would write to register SPD2R on the first slave by writing to the address 0xC002
(0xC000 for the I6 strobe, and 0x0002 for SPD2R on that slave).
2. If the master is writing multiple bytes, it should write to SPD0R last since that will
trigger an interrupt on the slave device. If only one byte is being sent, it should be
written to SPD0R.
3. The slave responds to the interrupt, reading the data from the slave port data registers.
19.3.4 Slave/Master Communication
1. The slave writes data to the appropriate slave port data register. If it is writing multiple
bytes, SPD0R should be written last, which enables the /SLVATTN line.
2. The master receives an external interrupt from the /SLVATTN line, and reads the data
out of the slave port data registers via external I/O reads on the data bus.
19.3.5 Handling Interrupts
The interrupt request on the slave is cleared by either the master or the slave accessing one
of the slave port registers. To clear the interrupt without affecting the register values, a
dummy write can be made to SPSR.
19.3.6 Example ISR
A sample interrupt handler is shown below.
slave_isr::
push af ; save used registers
; read the data sent by the master
ioi ld a, (SPD2R)
ld (to_slv_d2), a
ioi ld a, (SPD1R)
ld (to_slv_d1), a
ioi ld a, (SPD0R)
ld (to_slv_d0), a
; if a response is required, perform it here
ld a, (to_mas_d2)
ioi ld (SPD2R), a
ld a, (to_mas_d1)
ioi ld (SPD1R), a
ld a, (to_mas_d0)
ioi ld (SPD0R), a ; this write asserts /SLVATTN
; the interrupt request is cleared by any read/write of the registers
pop af ; restore used registers
ipres
ret
Содержание Rabbit 5000
Страница 1: ...Rabbit 5000 Microprocessor User s Manual 019 0168_E...
Страница 11: ...Table of Contents Appendix B Rabbit 5000 Errata 401 B 1 Errata 401 Index 405...
Страница 12: ...Rabbit 5000 Microprocessor User s Manual...
Страница 20: ...20 Rabbit 5000 Microprocessor User s Manual...
Страница 36: ...36 Rabbit 5000 Microprocessor User s Manual...
Страница 56: ...56 Rabbit 5000 Microprocessor User s Manual...
Страница 92: ...92 Rabbit 5000 Microprocessor User s Manual...
Страница 104: ...104 Rabbit 5000 Microprocessor User s Manual...
Страница 122: ...122 Rabbit 4000 Microprocessor User s Manual...
Страница 142: ...142 Rabbit 5000 Microprocessor User s Manual...
Страница 214: ...214 Rabbit 5000 Microprocessor User s Manual...
Страница 228: ...228 Rabbit 5000 Microprocessor User s Manual...
Страница 280: ...280 Rabbit 5000 Microprocessor User s Manual...
Страница 298: ...298 Rabbit 5000 Microprocessor User s Manual...
Страница 306: ...306 Rabbit 5000 Microprocessor User s Manual...
Страница 314: ...314 Rabbit 5000 Microprocessor User s Manual...
Страница 368: ...368 Rabbit 5000 Microprocessor User s Manual...
Страница 388: ...388 Rabbit 5000 Microprocessor User s Manual...
Страница 396: ...396 Rabbit 5000 Microprocessor User s Manual...
Страница 404: ...404 Rabbit 5000 Microprocessor User s Manual...