44
Rabbit 2000 Microprocessor
push af ;10
push hl
ld hl,(ptr) ;11
ld a,(hl) ;5
ioi ld (port),a ; 13 output data
inc hl
ld a,0x0f ;4
and l ; see if hl at end of cycle
jr z,step2
ld (ptr),hl
pop hl
pop af
reti
step2:
ld a,(beginptr)
ld l,a
ld (ptr),hl ;13
pop hl ;7
pop af
reti
; 103 clocks total
4.2 Open-Drain Outputs Used for Key Scan
The parallel port D outputs can be individually programmed to be open drain. This is use-
ful for scanning a switch matrix, as shown in Figure 4-2. A row is driven low, then the col-
umns are scanned for a low input line, which indicates a key is closed. This is repeated for
each row. The advantage of using open-drain outputs is that if two keys in the same col-
umn are depressed, there will not be a fight between a driver driving the line high and
another driver driving it low.
Figure 4-2. Using Open-Drain Outputs for Key Scan
o.d.
o.d.
+
+
+
+
+
+
+
Содержание 2000
Страница 1: ...Rabbit 2000 Microprocessor User s Manual 019 0069 041018 M...
Страница 12: ...6 Rabbit 2000 Microprocessor...
Страница 46: ...40 Rabbit 2000 Microprocessor...
Страница 54: ...48 Rabbit 2000 Microprocessor...
Страница 76: ...70 Rabbit 2000 Microprocessor...
Страница 96: ...90 Rabbit 2000 Microprocessor...
Страница 142: ...136 Rabbit 2000 Microprocessor...
Страница 154: ...148 Rabbit 2000 Microprocessor...
Страница 170: ...164 Rabbit 2000 Microprocessor...
Страница 174: ...168 Rabbit 2000 Microprocessor...
Страница 180: ...174 Rabbit 2000 Microprocessor...
Страница 202: ...196 Rabbit 2000 Microprocessor...
Страница 206: ...200 Rabbit 2000 Microprocessor...
Страница 226: ......
Страница 230: ...224 Rabbit 2000 Microprocessor...