6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Apr 29, 2024 3:56 am

All times are UTC




Post new topic Reply to topic  [ 163 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 11  Next
Author Message
PostPosted: Tue Oct 19, 2021 1:07 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
sburrow wrote:
floobydust wrote:
So, I'll still keep my opinion as is... simple and minimal is better for a first project.


I completely agree. I am doing just that. And thank you for your continued support and help. I don't plan on showing y'all anything until I'm super super sure about it. No more "hey look at this". I would like to run it by y'all just before I print a board, and that's it.

Other than that, is it ok if I ask smaller questions along the way? Like here is a question floobydust: Why 3.3K pull-up resistors? Why not 4.7K? Why not 5K? Why not 1K? Yes I could do the math, but the math seems screwy at times. I was working on a little LCD breadboard project a day or two ago, and I used 1K pull-up resistors and it worked great. I've seen different values all over the internet. Some folks even use 10K, for whatever reason. The idea is straightforward enough: Put in a resistor where enough voltage gets through that it still triggers a high-logic state, but when grounded the resistor keeps enough voltage back that it stays in a low-logic state.

Just a smaller question. Most folks on the internet seem to answer: "That's just what I've always done."

Anyways, thank you again for everything, sorry that my small question might be silly. No need to reply if it's too silly.

Chad


Sounds like a plan. However, as you have a breadboard, I would suggest that you divide your project into separate functional blocks and use the breadboard to test them. Functional blocks can be things as simple as the supervisory circuit on power up that provides the proper timing for the Reset signal and the Panic trigger for the NMI signal. Another block would be I/O decode... which you can easily test with some LEDs and a dropping resistor on the output of an I/O or memory select signal. The same goes for qualified read and write signals used by memory devices and non-65xx I/O peripheral devices. Get these functional blocks working so you know how they operate and can feel confident that when used in a complete system they will function as intended.

3.3K... well, not that much of a ground rule, but the general consensus with the newer CMOS processors is to use 3.3K for all pull-ups. Sure, you could spend time calculating slew rates versus signal timings and the capacitive load on each signal (IRQ, NMI, etc.), but it's just easy to go with a 3.3K pull-up and call it done. I've actually run at 10MHz clock speeds with no errors, and I always use IRQ-driven I/O on pretty much all (I/O) devices. BTW - I use LEDs (for indication) which are rated at 1ma active current, so a 3.3K works out perfect as a dropping resistor for these as well.

Lastly... just realize that the number 1 goal is to get something working. Also, once you have a working design, you'll obviously get to a point where you'll ditch it for the next design that has more features/functions and newer and better ideas. It's a journey... not a one-off for all of time.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 19, 2021 1:45 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8154
Location: Midwestern USA
sburrow wrote:
Why 3.3K pull-up resistors? Why not 4.7K? Why not 5K? Why not 1K? Yes I could do the math, but the math seems screwy at times.

I see floobydust jumped in while I was typing, but I'll answer anyhow. :D

The value of a pullup resistor is ultimately a compromise and its lower limit is bound to the current-sinking capability of whatever is connected to it. That is, the resistance can't be too low lest the device connected to it be forced to sink too much current, which may open the door to failure. At the same time, if the resistance is too high the circuit can become "lazy" and noise-sensitive, things that absolutely must be avoided in interrupt circuits.

In most circuits, 3.3K is "traditional" because back in the days of LS-TTL logic, which has relatively weak drive capabilities, 3.3K was about as low as one could safely go and not put the part that was sinking the circuit under too much stress. Also, if there were numerous circuits with numerous pull-up resistors, aggregate power consumption and heat dissipation could become an issue (early computers with gobs of TTL logic ran pretty hot, which is why computer rooms were heavily air-conditioned).

I've pretty much stuck with 3.3K in my builds and have not had any issues, even at 20 MHz. With some devices, lower values would be acceptable but unless there is a fulminating need to do otherwise, I'd stick with 3.3K. I definitely would not go any higher.

Speaking of interrupt circuits, with the exception of the WDC 65C22S, all 65xx peripheral devices have open-collector IRQ outputs (also true of many non-65xx peripherals), which means that while an interrupting device can readily drive the circuit low, it can't drive it high, leaving that task to the pull-up resistor.

The problem comes in the fact that parasitic capacitance that is endemic to all computer circuits has to be recharged through the pull-up resistor, and that takes time. If the IRQ circuit's pull-up is too high a value, the time it takes for the IRQ circuit to return to the quiescent state once an interrupt has been cleared will be excessive and may result in a spurious (aka "ghost" or "phantom") interrupt. Ask Garth about that...he's had it happen to him. :D

A spurious interrupt can result in the system going haywire for no apparent reason, unless the interrupt service routine is carefully crafted to account for the possibility. Both Garth's and my interrupt articles describe this phenomenon.

In a nutshell, you minimize spurious interrupt risks by keeping connections short, using an appropriately-sized pull-up resistor, and by writing your interrupt handler so it clears interrupt sources as early as possible to give the IRQ line sufficient time to go quiescent before the interrupt handler has finished its work and returned to the foreground. If the IRQ line has not reached a quiescent level by the time the interrupt handler has finished up, another IRQ will occur even though nothing is actually asking for service. That is a spurious interrupt.

Quote:
I was working on a little LCD breadboard project a day or two ago, and I used 1K pull-up resistors and it worked great. I've seen different values all over the internet. Some folks even use 10K, for whatever reason.

Dropping (not "pull-up") resistors for LEDs are selected so a specific amount of current will flow when the LED is energized. You calculate the resistor value with basic Ohm's law equations, using the LED's recommended forward voltage drop and current ratings as a guide. If I'm energizing an LED from 5 volts I typically use 330 ohms, which produces about 10mA forward current with the LEDs I use. That's more than enough for reasonable brightness.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 19, 2021 10:14 am 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
floobydust wrote:
Lastly... just realize that the number 1 goal is to get something working.


That is indeed the goal, thank you.

Thank you floobydust and BDD for the 3.3K pull-up resistor explanation. Seems like the way to go for sure. And thank you BDD for clarifying the open-collector part. And also thank you for reminding me about the ghost IQR signal, I remember reading that on Garth's page in particular.

And the functional blocks sounds good too, floobydust. I have seen some folks use silkscreen to show those blocks. I will keep that in mind as I continue.

Thank you both very much for your support.

Chad


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 19, 2021 2:20 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3349
Location: Ontario, Canada
BigDumbDinosaur wrote:
If I'm energizing an LED from 5 volts I typically use 330 ohms, which produces about 10mA forward current with the LEDs I use.
Just a quick footnote. 10 mA may be reasonable for older LEDs, but modern, high-efficiency LEDs require far less (1 or 2 mA maybe).

Less is more, in the sense that it'll be best to keep the DC loading to a minimum (in the scenario where the LED is being driven by a bus line or a gate, I mean). Also, and perhaps surprisingly, there is such a thing as LEDs being too bright (actually unpleasant to view)!

For these reasons I suggest being prepared to use the largest series resistor possible. And if the resistors are in an array (perhaps a SIP array) that's socketed, you can quite easily change the value after your project is already built.

ETA: I don't necessarily advocate LEDs, by the way. In some situations they're worthwhile (and the certainly parts are inexpensive). But if you don't have single-step then they're perhaps not very useful, and if you're doing a PCB you may decide they consume too much space.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 19, 2021 3:40 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
Good to note, thank you.

I think BDD started talking about LED's because I said I was working with an LCD, like a 16x2 kind. But either way it's good info.


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 19, 2021 6:34 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8154
Location: Midwestern USA
Dr Jefyll wrote:
BigDumbDinosaur wrote:
If I'm energizing an LED from 5 volts I typically use 330 ohms, which produces about 10mA forward current with the LEDs I use.

Just a quick footnote. 10 mA may be reasonable for older LEDs, but modern, high-efficiency LEDs require far less (1 or 2 mA maybe).

I've got tons of "older LEDs." :D Frugality compels me to use 'em up.

Quote:
Also, and perhaps surprisingly, there is such a thing as LEDs being too bright (actually unpleasant to view)!

Just wait until you get to my age and acquire my vision. :shock: There won't be such a thing as "too bright." :lol:

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 11:23 am 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 586
Location: Michigan, USA
Hey guys. I'm curious if there's any reason I shouldn't use a MOSFET as an inverter for the SCC2691 'RESET' line?

TIA... Mike


Attachments:
temp3.png
temp3.png [ 57.9 KiB | Viewed 4589 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 11:44 am 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
Mike, that is a great question. I would also like to know! Thank you all.

Chad


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 12:51 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3349
Location: Ontario, Canada
Haven't you forgotten to include a pullup resistor, Michael? (Edit: oops, I see one is indicated) But the idea is workable. Does the incoming signal ( /RES ) swing from 0 to 5 Volts? You'll wanna be sure to select a MOSFET that will turn on sufficiently, given the available incoming voltage.

If your motivation for doing all this is to save space, you might want to consider simply using a 74LVC2G04 instead. This is a miniature SMT device with only 6 pins (and hence only 2 inverters). For more on the 1G and 2G series, see my post, Tiny, superfast gates rival programmable logic.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 1:02 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
I would watch out for the edge rates: certainly coming out of reset, and possibly going into reset, you need quite a decisive signal. Too slow, and the device might malfunction. (This is a general point: it's possible the specific device here is very defensively designed. Check the spec for the reset input.)


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 5:50 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8154
Location: Midwestern USA
Michael wrote:
Hey guys. I'm curious if there's any reason I shouldn't use a MOSFET as an inverter for the SCC2691 'RESET' line?

TIA... Mike

I don't see any reason why not, as long, as Ed noted, the signal edges aren't too slow. I've not tried it because I've always seem to have had a spare gate to act as an inverter.

BTW, the 2691 is obsolete—you may want to consider a newer NXP UART with faster bus timings. Also, the 2691 doesn't have a transmitter FIFO, which means it will interrupt on every datum sent. The newer NXP UARTs have such FIFOs and only interrupt at 8- or 16-datum intervals if correctly set up.

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 6:14 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
BigDumbDinosaur wrote:
BTW, the 2691 is obsolete—you may want to consider a newer NXP UART with faster bus timings. Also, the 2691 doesn't have a transmitter FIFO, which means it will interrupt on every datum sent. The newer NXP UARTs have such FIFOs and only interrupt at 8- or 16-datum intervals if correctly set up.


And, just by my looking around a bit, the SCC2691 is hard to find, at least in DIP package.

Anyways, new question:

Does the 6522 VIA R/W input need to be qualified with Phi2? I know we have discussed that for RAM (and ROM), but does the VIA also need that same qualification? Would it hurt to use that same line for RAM, ROM, and VIA?

Chad


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 6:27 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 586
Location: Michigan, USA
Dr Jefyll wrote:
If your motivation for doing all this is to save space, you might want to consider simply using a 74LVC2G04 instead. This is a miniature SMT device with only 6 pins (and hence only 2 inverters). For more on the 1G and 2G series, see my post, Tiny, superfast gates rival programmable logic.

I remember that post on those fascinating products, Jeff. Thank you.

Actually, that TL770B supervisor chip that Kevin (floobydust) uses isn't very expensive. I just happen to have a bin full of 2N7000's.


Last edited by Michael on Sat Oct 23, 2021 12:44 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 6:32 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 586
Location: Michigan, USA
sburrow wrote:
Does the 6522 VIA R/W input need to be qualified with Phi2? I know we have discussed that for RAM (and ROM), but does the VIA also need that same qualification? Would it hurt to use that same line for RAM, ROM, and VIA?

I believe 6500 and 6800 peripherals qualify the R/W input with the PHI2 clock input internally.


Last edited by Michael on Wed Oct 20, 2021 6:40 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 20, 2021 6:38 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
Michael wrote:
6500 and 6800 peripherals use the R/W signal and the PHI2 clock signal from the CPU.


So... a direct connection. Ok! Thank you.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 163 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 11  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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: