PLD Help wanted!

Hi All, I have recently seen a PCB that uses a GAL16V8 to control a 4x7 keyboard matrix. The company that made the PCB no longer exist and the GAL is dead! It appears to me that the terminals 17-19 are used to address the row and then read back the column. I have no schematic for this PCB but this is how its been reversed engineered. Row 0-4 are on pins 13-16 Col 0-6 are on pins 2-8 Write pin 1 Read pin 9 D0-D2 are on pins 17-19 Keypad Interupt Pin 12 I have only ever used a PLD to do simple addressing and never used the pins to be bi-directional. Can anyone help in showing me how this can be achieved?

Many thanks

Reply to
slodgey
Loading thread data ...

"slodgey" schreef in bericht news: snipped-for-privacy@g43g2000cwa.googlegroups.com...

That's not too difficult. The "output" cells have a product term that controls the output. When activated, the corresponding output driver goes tri-state but the internal feedback stays active. This way the pin can be used for input. So the read pin (9) is used to keep D0-D2 (17-19) tristate, then a pulse on write (1) is used to clock the (decoded) addresses into the output cells (13-16) of the rows. Now the outputs of the component that provided the row address are made tristate, then the read pin (9) is used to release the tristate of the D0-D2 (17-19), at the same time putting the encoded column on them.

So D0-D2 is a real bidirectional databus.

As for the interrupt, I guess it is activated when, after a write, the column appears to be nonzero.

petrus bitbyter

Reply to
petrus bitbyter

Many thanks, I'll give it a go!

Reply to
slodgey

I still need help! After trying, I now get an error of Invalid input pin 19. How do I define these pins D0-D2 (17-19). Can anyone give me an example piece of code to show me how to use these pins as bi-directional I/O.

Many thanks

Reply to
slodgey

"slodgey" schreef in bericht news: snipped-for-privacy@z14g2000cwz.googlegroups.com...

What tool do you use? FAIK there is no need to specify the outputs for I/O. You simply set the other outputs according to the value that appears on these output pins (D0-D2). The older tools I'm aware of do not bother whether that value comes from the output cells (when activated) or from the bus (when the outputs are in tristate). Maybe newer tools like VHDL do check this situation as they need it for simulation.

(Even then, I like a warning rather then an error report. Of couse you are forced to specify correctly this way but I hate to be forced.)

Can you write (a part of) the code you've written along with the tool you used for it?

petrus bitbyter

Reply to
petrus bitbyter

The Tool I use is for ATMEL PLD's (Win CUPL). I have now tried it on an old version of this compiler and the error has gone! I haven=92t had time to program a device yet to try it, but things seem to be going in the right direction!! thanks

Reply to
slodgey

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.