title LED matrix control PAL pattern leds.pds revision 3 author Bret Victor company stupid date 9/98 chip U1 PAL22V10 ;Pins pin 1 CLK ;input clock pin 2 BOARDSEL ;input board select (active low) pin 3 RNOTW ;input read / not write pin 4 A0 ;input A0 address line pin 5 A1 ;input A1 address line pin 6 D0 ;input D0 data line pin 7 D1 ;input D1 data line pin 8 D2 ;input D2 data line pin 9 D3 ;input D3 data line pin 10 D4 ;input D4 data line pin 11 nc11 ;input nothing yet pin 12 GND ;supply power ground pin 13 nc13 ;input nothing yet pin 14 COL0 reg ;output column decoder bit 0 pin 15 COL1 reg ;output column decoder bit 1 pin 16 COL2 reg ;output column decoder bit 2 pin 17 COL3 reg ;output column decoder bit 3 pin 18 COL4 reg ;output column decoder bit 4 pin 19 NOTCOL3 reg ;output inverse COL3 for last decoder pin 20 DISABLE reg ;output /OE for display driver pin 21 nc21 ;i/o nothing yet pin 22 PALCLK comb ;output clock to drive this PAL! pin 23 LATCHCLK comb ;output clock to drive the data latch pin 24 VCC ;supply power VCC ; To set column number, write to address 0 ; To set row data, write to address 1 ; To enable display, write a 1 to address 2 ; To disable display, write a 0 to address 2 string SetColumn '(/A0 * /A1)' string SetRow '( A0 * /A1)' string SetDisable '(/A0 * A1)' EQUATIONS ; want to clock on the rising edge (end of pulse) PALCLK = BOARDSEL LATCHCLK = /(/BOARDSEL * SetRow) ; COL just latches in D when the PAL clocks COL0 := ( D0 * SetColumn) + (COL0 * /SetColumn) COL1 := ( D1 * SetColumn) + (COL1 * /SetColumn) COL2 := ( D2 * SetColumn) + (COL2 * /SetColumn) COL3 := ( D3 * SetColumn) + (COL3 * /SetColumn) COL4 := ( D4 * SetColumn) + (COL4 * /SetColumn) NOTCOL3 := (/D3 * SetColumn) + (NOTCOL3 * /SetColumn) ; DISABLE latches in /D0 when the PAL clocks DISABLE := (/D0 * SetDisable) + (DISABLE * /SetDisable) ; That wasn't very hard now, was it?