Hi guys
I suspect that this isn't possible with WinCUPL, but does anyone know if there's a way of set a pinnode to a specific value (1 or 0) without connecting it to an external pin? I.e. internally connect a pin to GND or VCC? I'm trying the have an addressable (by the MPU) eight bit latch held within an ATF1508AS with bit fields 0,1,2 set by external signals. That's fine and easy to do. However, I want bits 7,6,5,4,3 held low, so when the latch is read, there is no need to use AND #%00000111 (this assumes that if they are not set, then they will float).
I could set up an I/O pin for called 'low' and connect it (via a pull down resistor) to ground, but I'd rather not use a pin for this if I can help it.
Another way to do it is set each unused element to MPU's RESB, as when the latch is read, RESB is high, so it will means it will be inverted to low.
Something like:
Code:
/* MPU data bus and address bus assignments & decoding not shown here to keep things simple */
/* pin definitions */
Pin 1 = RESB;
Pin = detect_PCIA; /* detection line for PCI slot A. =1 detected, =0 not detected */
Pin = detect_PCIB; /* detection line for PCI slot B. =1 detected, =0 not detected */
Pin = detect_PCIC; /* detection line for PCI slot C. =1 detected, =0 not detected */
pinnode = latchSelC; /* latch C selected flag */
/* latch input assignments */
reglatchC0.L = detect_PCIA;
reglatchC1.L = detect_PCIB;
reglatchC2.L = detect_PCIC;
reglatchC3.L = !RESB;
reglatchC4.L = !RESB;
reglatchC5.L = !RESB;
reglatchC6.L = !RESB;
reglatchC7.L = !RESB;
/* always latch inputs while RESB is high */
[reglatchC7..0].LE = RESB;
/* only output to MPU data bus if the latch address is selected by the MPU address bus. This is more complicated due to the other registers, but I've made it simpler here (and removed output node definitions and assignments) to keep clear */
[D7..0].OE = RWB & latchSelC;
BTW I googled and checked the WinCUPL 'manual' that I have and, so far, can't see a way to do this. If I've missed something stupidly obvious then please poke fun gently
.