interrupt problem...

For discussing the 65xx hardware itself or electronics projects.
Post Reply
User avatar
lenzjo
Posts: 42
Joined: 03 May 2015
Location: London, UK
Contact:

interrupt problem...

Post 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?
Attachments
interrupts.png
interrupts.png (4.03 KiB) Viewed 753 times
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: interrupt problem...

Post 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.
User avatar
lenzjo
Posts: 42
Joined: 03 May 2015
Location: London, UK
Contact:

Re: interrupt problem...

Post 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.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: interrupt problem...

Post 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.
Last edited by BigDumbDinosaur on Mon May 24, 2021 7:28 pm, edited 2 times in total.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: interrupt problem...

Post 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".
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

Re: interrupt problem...

Post 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?
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: interrupt problem...

Post 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'.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
lenzjo
Posts: 42
Joined: 03 May 2015
Location: London, UK
Contact:

Re: interrupt problem...

Post 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.
gbm
Posts: 43
Joined: 23 Jan 2018

Re: interrupt problem...

Post 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.
User avatar
lenzjo
Posts: 42
Joined: 03 May 2015
Location: London, UK
Contact:

Re: interrupt problem...

Post by lenzjo »

I'm crap at analog electronics stuff so I didn't even think about that ;)
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: interrupt problem...

Post 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.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Post Reply