Page 1 of 1

interrupt problem...

Posted: Mon May 24, 2021 10:09 am
by lenzjo
Can somebody tell me what is wrong with this? VIA_IRQ is from a WD65C22 (S variant), ACIA_IRQ is from an MC68B50P and IRQ is connected to the WD65C02's interrupt pin. If I jumper either of the irqs to the output of the inverter then that interrupt goes thru to the processor. As wired, the IRQ line is permanently high. I have replaced both the hc00 and hc04 and metered the traces for continuity all's good but still no worky... I'm at a loss of what else could be wrong with this. Any ideas?

Re: interrupt problem...

Posted: Mon May 24, 2021 11:23 am
by BigEd
If you need a pullup on the VIA IRQ, you might well also need one on the ACIA IRQ. If the point is that these are open-collector, then they need a pullup.

But by the same token, if they are open-collector, they can both be directly connected to the IRQ input, and share a single pullup. The point of open-collector is that the device's output pin is only able to drive low, or not drive at all. Tying two together, with a pullup, makes an AND gate.

Re: interrupt problem...

Posted: Mon May 24, 2021 1:39 pm
by lenzjo
Thank you BigEd, from memory I remembered it as being "TTL compatible". Going back to the data-sheet after your reply I saw that it was "TTL compatible, open-drain (no internal pullup)". So I added a 3.3k resistor on the back of the pcb to pin 10 and 5v and now it's working fine.

Re: interrupt problem...

Posted: Mon May 24, 2021 7:25 pm
by BigDumbDinosaur
lenzjo wrote:
Can somebody tell me what is wrong with this? VIA_IRQ is from a WD65C22 (S variant), ACIA_IRQ is from an MC68B50P and IRQ is connected to the WD65C02's interrupt pin. If I jumper either of the irqs to the output of the inverter then that interrupt goes thru to the processor. As wired, the IRQ line is permanently high. I have replaced both the hc00 and hc04 and metered the traces for continuity all's good but still no worky... I'm at a loss of what else could be wrong with this. Any ideas?

In the future, please post schematics in monochrome.

The 65C22S has a totem-pole IRQ output, hence does not require a pullup resistor. On the other hand, the 68B50 is open-drain and does require a pullup. Recommended value is 3.3K.

Also, if you use a positive-AND, such as a 74xx08, instead of the NAND followed by the inverter, your circuit will be more responsive to IRQs (two gate delays with your present arrangement vs. one), which may be important with a UART such as the 6850, as it has no FIFOs.

Re: interrupt problem...

Posted: Mon May 24, 2021 7:27 pm
by BigDumbDinosaur
BigEd wrote:
The point of open-collector is that the device's output pin is only able to drive low, or not drive at all. Tying two together, with a pullup, makes an AND gate.

Actually, it is the equivalent of an OR gate, which is why such an arrangement is referred to as "wired-OR".

Re: interrupt problem...

Posted: Mon May 24, 2021 8:40 pm
by barrym95838
BigDumbDinosaur wrote:
BigEd wrote:
The point of open-collector is that the device's output pin is only able to drive low, or not drive at all. Tying two together, with a pullup, makes an AND gate.

Actually, it is the equivalent of an OR gate, which is why such an arrangement is referred to as "wired-OR".
Please forgive my potential ignorance, but if an output is low if either input is low, isn't that pretty much the definition of AND?

Re: interrupt problem...

Posted: Mon May 24, 2021 8:50 pm
by enso
Mike, what you say is necessary, but not sufficient for an AND. If either is low, the result is 0. However, if both are low the result is also 0. The defining characteristic of an AND is that it is 1 only if both inputs are 1.

Logical AND:

Code: Select all

A  B   OUTPUT
=============
0  0   0
0  1   0
1  0   0
1  1   1
Logical OR:

Code: Select all

A  B   OUTPUT
=============
0  0   0
0  1   1
1  0   1
1  1   1
If we are dealing with negative logic, wired OR is pulled up normally, and drops low if any (or both) of the inputs go low:

Negative logic OR:

Code: Select all

A  B   OUTPUT
=============
0  0   0
0  1   0
1  0   0
1  1   1
Which looks a lot like positive logic AND, doesn't it? As they used to say in the Soviet Union at the end of televised children's competitions always ending in a tie, 'friendship wins'.

Re: interrupt problem...

Posted: Mon May 24, 2021 10:09 pm
by lenzjo
BigDumbDinosaur wrote:
lenzjo wrote:
Also, if you use a positive-AND, such as a 74xx08, instead of the NAND followed by the inverter, your circuit will be more responsive to IRQs (two gate delays with your present arrangement vs. one), which may be important with a UART such as the 6850, as it has no FIFOs.
Thanks for the advice BDD, but I had a spare 74hc00 gate available and there's no room on the pcb for another 14pin dip. I'm not that concerned about the 2-gate delay, the board is running at only 2Mhz and after look at some of the interrupt priority circuits out there a 2-gate delay looks to be nothing in comparison to some.

Re: interrupt problem...

Posted: Thu May 27, 2021 6:57 am
by gbm
How about using two diodes and a resistor to form a diode gate, instead of 74xx gates? Timing parameters are not important in this case - CPU cycle is an order of magnitude longer than any gate delays.

Re: interrupt problem...

Posted: Thu May 27, 2021 1:17 pm
by lenzjo
I'm crap at analog electronics stuff so I didn't even think about that ;)

Re: interrupt problem...

Posted: Thu May 27, 2021 5:11 pm
by BigDumbDinosaur
gbm wrote:
How about using two diodes and a resistor to form a diode gate, instead of 74xx gates? Timing parameters are not important in this case - CPU cycle is an order of magnitude longer than any gate delays.

A standard silicon diode (e.g., 1N4152) should not be used due to its forward drop.  A small-signal Schottky should be used. Only the 65C22's IRQ output would have to be so isolated.