I'll deal with the dual-540 setup later.
I now have to find out how to use bi-directional pins in the CPLD. There's a hint in the CUPL manual, but it refers to a application manual that is not available to me.
I have already routed the AD bus to the CPLD and successfully implemented a '573 external address latch, producing the A0-7 part of the address bus.
However, I also need to interface this bus with the above mentioned keypad signals, and thus need to program this in a bi-directional fashion. I have read somewhere that bi-directional pins needs to be read using the .IO extension, and any output must be done by the use of the .oe extension.
Code:
/* Input pins */
PIN = [KEY7..0];
PIN = GATE1;
PIN 43 = AS; /*GCLK1*/
PIN 2 = GATE2; /* GCLK2 */
/* Output pins */
PIN = [A7..0];
/* Bi-directional pins */
PIN = [AD7..0];
/* '573 latch implementation */
[A7..0].l = [AD7..AD0].io;
[A7..0].le = AS;
/* Keypad input interface */
[AD7..AD0]= ![KEY7..0];
[AD7..AD0].oe = !GATE1 & !GATE2;
Would the above be the correct definition of the bi-directional AD bus here? (
.io used in latch input and
.oe use din the key value output?
I need to use this bus as input to other logic functions as well in the CPLD. I guess I can do this, but also need to use the .io extension in these statements?
Thanks in advance and cheers from,
Tore