6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Sep 21, 2024 2:13 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: interrupt problem...
PostPosted: Mon May 24, 2021 10:09 am 
Offline
User avatar

Joined: Sun May 03, 2015 7:07 pm
Posts: 42
Location: London, UK
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 619 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Mon May 24, 2021 11:23 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Mon May 24, 2021 1:39 pm 
Offline
User avatar

Joined: Sun May 03, 2015 7:07 pm
Posts: 42
Location: London, UK
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Mon May 24, 2021 7:25 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
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.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Mon May 24, 2021 7:28 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Mon May 24, 2021 7:27 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Mon May 24, 2021 8:40 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
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)


Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Mon May 24, 2021 8:50 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 899
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:
A  B   OUTPUT
=============
0  0   0
0  1   0
1  0   0
1  1   1


Logical OR:
Code:
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:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Mon May 24, 2021 10:09 pm 
Offline
User avatar

Joined: Sun May 03, 2015 7:07 pm
Posts: 42
Location: London, UK
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Thu May 27, 2021 6:57 am 
Offline

Joined: Tue Jan 23, 2018 2:55 pm
Posts: 43
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Thu May 27, 2021 1:17 pm 
Offline
User avatar

Joined: Sun May 03, 2015 7:07 pm
Posts: 42
Location: London, UK
I'm crap at analog electronics stuff so I didn't even think about that ;)


Top
 Profile  
Reply with quote  
 Post subject: Re: interrupt problem...
PostPosted: Thu May 27, 2021 5:11 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8390
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: