4.12 Keypad (optional)
Port A is an 8-bit bi-directional port. Its primary usage is for a 4X4 keypad. If the port is not
used for the keypad, it can be used as a general-purpose I/O.
The schematic for the keypad connections is shown below:
PA0 PA1 PA2 PA3
Col_0 Col_1 Col_2 Col_3
PA4, Row_0
PA5, Row_1
PA6, Row_2
PA7, Row_3
Keypad connections:
PA0 connects COL0 of the keypad
PA1 connects COL1 of the keypad
PA2 connects COL2 of the keypad
PA3 connects COL3 of the keypad
PA4 connects ROW0 of the keypad
PA5 connects ROW1 of the keypad
PA6 connects ROW2 of the keypad
PA7 connects ROW3 of the keypad
Keypad scan routine sets PA3 low and PA0, PA1,PA2 high, then tests PA4-PA7.
If no key is down, PA4-PA7 remain high.
If PA7 = low, the key 15 is down.
If PA6 = low, the key 14 is down.
If PA5 = low, the key 13 is down.
If PA4 = low, the key 12 is down.
Keypad scan routine sets PA2 low and PA0, PA1, PA3 high, then tests PA4-PA7.
If no key is down, PA4-PA7 remain high.
If PA7 = low, the key 11 is down.
If PA6 = low, the key 10 is down.
If PA5 = low, the key 9 is down.
If PA4 = low, the key 8 is down.
Keypad scan routine sets PA1 low and PA0, PA2, PA3 high, then tests PA4-PA7.
If no key is down, PA4-PA7 remain high.
If PA7 = low, the key 7 is down.
If PA6 = low, the key 6 is down.
If PA5 = low, the key 5 is down.
If PA4 = low, the key 4 is down.
28
Содержание MiniDragon-Plus2 Trainer
Страница 1: ...MiniDragon Plus2 Trainer ForFreescaleHCS12microcontrollerfamily User sManual Revision 1 03 ...
Страница 6: ...Fig 1 1 MC9S12DG256 Memory map 6 ...
Страница 7: ...Fig 1 2 MC9S12DG256 MCU block diagram 7 ...
Страница 35: ...8 2 Interrupt vector table Fig 8 2 MC9S12DG256 Interrupt vector table 1 35 ...
Страница 36: ...Fig 8 3 MC9S12DG256 Interrupt vector table 2 36 ...
Страница 37: ...Fig 8 4 MC9S12DG256 secondary interrupt vector table 37 ...