DerTrueForce wrote:
Anyroad, I have attached the CUPL equation file.
The logic mostly looks fine. However, as written, the following statements will not work as expected:
Code:
PIN 16 = RD ; /* */
PIN 17 = WR ; /* */
...
RD = PHASE_2 & RW;
WR = PHASE_2 & !RW;
In the above, you have declared the
RD and
WR pins as active high outputs, which is incorrect.
RD = PHASE_2 & RW will cause
RD to go high when Ø2 and
RW (the 65C02's
RWB output) are high. Similarly, the expression
WR = PHASE_2 & !RW will cause
WR to go high when Ø2 is high and
RW is low.
The correct code would be:
Code:
PIN 16 = !RD; /* declare as active low output */
PIN 17 = !WR; /* declare as active low output */
...
RD = PHASE_2 & RW; /* RD will go low when Ø2 & RWB are high */
WR = PHASE_2 & !RW; /* WR will go low when Ø2 is high & RWB is low */
The declaration of the pin name with the negation symbol (
!) tells WINCUPL this is an active low output.
Some of your other logic can be rewritten as well, viz.:
Code:
PIN 13 = !UART; /* declare UART chip select as low true */
...
UART = !A15 & A14 & !A13 & A12; /* select UART if A15-A12 = %0101, or $5xxx */
Depending on the device being used, the above may use fewer product terms than the same statement as you wrote it.
Give it a try and see if it will work.