
PSD GPLD Primer - PSD6XX/7XX/8XX é Application Note
055
WSi Inc. Fremont CA 800-832-6974 www.wsipsd.com
31
0113 |
0114 |"**** Standard definitions
0115 |
0116 |X = .x.; "Don't care
0117 |clk = .c.; "Clock pulse
0118 |Page = [pgr3..pgr0]; "PSD Page register
0119 |Address = [a15..a0]; "Address bus
0120 |
0121 |"**** Property statements
0122 |
0123 |WSIPSD PROPERTY 'Address_out Aout[2:0]:Addr_out[2:0] PortA';
0124 |"**** Assigns three demultiplexed MCU address lines to pins on PortA
0125 |
0126 |WSIPSD PROPERTY 'DataBus_OMC D[7:5]:Counter[2:0] MCELLAB';
0127 |"**** Assign Output MicroCells to the high end of Port B.
0128 |"**** The MCU can load and read the hold counter for testing.
0129 |
0130 |WSIPSD PROPERTY 'DataBus_OMC D[2:0]:FirstCnt[2:0] MCELLC';
0131 |"**** Assign Output MicroCells to the low end of Port C.
0132 |"**** The MCU will hold the initial hold timer count.
0133 |
0134 |WSIPSD PROPERTY 'DataBus_IMC D[7:0]:Key[13:6] PortB';
0135 |WSIPSD PROPERTY 'DataBus_IMC D[6:3]:Key[5:2] PortC';
0136 |WSIPSD PROPERTY 'DataBus_IMC D[1:0]:Key[1:0] PortC';
0137 |"**** Assign Input Microcells so the MCU can read the
0138 |"**** key inputs by reading the Input Microcell registers
0139 |"**** in CSIOP space. These key values will be latched
0140 |"**** by the falling edge of ClkIn.
0141 |
0142 |
0143 |"**** User-defined sets
0144 |
0145 |ManKeys = [Key1, Key0]; "Keys that do not auto-repeat
0146 |NO_MAN_KEYS = [1, 1]; "Key state when not pressed
0147 |
0148 |AllKeys = [Key13..Key0];
0149 |
0150 |
0151 |Counter = [Counter2..Counter0]; "Delay counter (button hold time)
0152 |FirstCnt = [FirstCnt2..FirstCnt0]; "Delay value for first repeat
0153 |RptCnt = [0,FirstCnt2,FirstCnt1]; "Delay value for subsequent repeats.
0154 | "This repeat value is half of FirstCnt
0155 |
0156 |"**** State labels
0157 |ST_NO_KEY = 0; "State when no key is pressed
0158 |ST_INT1 = 1; "State when key is first pressed
0159 |ST_INT_RPT = 2; "State when key press is repeated
0160 |ST_HELD_KEY = 3; "State when delaying while key is held down
0161 |
0162 |PressState = [q1, q0]; "Registers that implement state machine.
0163 | "This state machine will advance on the
0164 | "rising edge of ClkIn.
0165 |
0166 |
0167 |
0168 |EQUATIONS
0169 |
0170 |"******** DPLD equations *****************************************
0171 |
0172 | "All internal chip selects are active high.