
PSD GPLD Primer - PSD6XX/7XX/8XX é Application Note
055
WSi Inc. Fremont CA 800-832-6974 www.wsipsd.com
29
PSDabel File (keypad.lst)
0001 |module keypad
0002 |
0003 |title 'WSI PSD6XX auto-repeat keypad reader for 68HC11';
0004 |
0005 |
0006 |"**** This PSD will input and debounce 14 keypad inputs and generate
0007 |"**** an interrupt signal, Intr, to the HC11 when a key is pressed.
0008 |"**** When a key other than Key0 or Key1 is held down, Intr signals
0009 |"**** the MCU periodically so that the key effectively auto-repeats.
0010 |"**** The period of the first repeat cycle is programmable by the MCU
0011 |"**** and the period of the subsequent repeating cycles is fixed at
0012 |"**** half of the period of the first. At power-up, the MCU will
0013 |"**** write to Output MicroCells to set the programmable period.
0014 |"**** This value only needs to be written once. When the MCU services
0015 |"**** the button press interrupt, it will read the Input MicroCells
0016 |"**** to determine the pressed key(s). A state machine drives the
0017 |"**** sequencing of the keypad interpreter.
0018 |
0019 |
0020 |"PIN DECLARATIONS
0021 |
0022 |"******** Bus Interface signals declaration *********************
0023 |
0024 |"***** The following are 68HC11 bus input signals to the PSD PLDs.
0025 |"***** In PSDsoft Configuration dialog boxes, you must select the
0026 |"***** 68HC11 bus interface: 8-bit data, mux bus, r_w, and e signal
0027 |"***** with active high ale/as.
0028 |
0029 |"***** Signals with reserved names need no pin numbers since the
0030 |"***** PSDsoft compiler will assign them automatically.
0031 |
0032 |e pin; "E clock
0033 |r_w pin; "read/write signal
0034 |as pin; "address strobe
0035 |reset pin; "system reset
0036 |
0037 |"psen pin 49; The PSEN pin is not used in Motorola MCU
0038 | " applications.
0039 |
0040 |
0041 |"**** The following are latched MCU address lines that are available
0042 |"**** as input to the PLDs. (Pins numbers are predefined.)
0043 |
0044 |a7,a6,a5,a4,a3,a2,a1,a0 pin;
0045 |a15,a14,a13,a12,a11,a10,a9,a8 pin;
0046 |
0047 |
0048 |"******** Port A, B, C, D pin/node declarations ***********************
0049 |
0050 |
0051 |"**** Port A *******************
0052 |Control pin 21; "pa7 - Output, MCU I/O mode, Open drain
0053 |In_Out pin 22; "pa6 - Bi-Directional, MCU I/O Mode
0054 |Status pin 23; "pa5 - Input, MCU I/O mode