Newbie 6502 breadoard computer advice
Newbie 6502 breadoard computer advice
Hello 6502 forum! After being interested in retrocomputing for quite a long time, I finally decided to build something with 6502. With the help of 6502 datasheet and Ben Eater's video I wired some pins to VCC and GND. The reasons behind every action were pretty easy to understand despite my knowledge of electronics being pretty basic. But I didn't understand why did he use resistors when hard-wiring NOP to the data bus. How does it protect the 6502?
Can I power my computer with a 5V 1A DC charger?
Also, I would like to know things I should avoid doing to avoid damaging my ICs. Should I look for something like maximum current and voltage in the dtasheets?
Can I power my computer with a 5V 1A DC charger?
Also, I would like to know things I should avoid doing to avoid damaging my ICs. Should I look for something like maximum current and voltage in the dtasheets?
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: Newbie 6502 breadoard computer advice
Jock wrote:
... But I didn't understand why did he use resistors when hard-wiring NOP to the data bus. How does it protect the 6502?
Accidents happen all the time, and it's sound engineering practice to make some effort to mitigate the negative effects when they inevitably occur.
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)
Mike B. (about me) (learning how to github)
Re: Newbie 6502 breadoard computer advice
Welcome, Jock
Mike is right on target re those resistors -- they're a precaution. All being well (ie, as planned, you do nothing but NOP's) they're not necessary, because NOP's only read (input from) the data bus. But "stuff happens," and it's possible you might accidentally cause a write cycle, and outputting to the data bus would cause excessive current to flow were the resistors not present. The excessive current might damage the chip, but they are surprisingly robust.
To avoid damaging your ICs your biggest concern (especially in winter) is probably ESD (static electricity). Ideally you should use a wrist strap to ground yourself but the 2nd-best solution (and one I use myself) is to always touch a grounded object before handling the project.
AND!! Make sure your ambient humidity doesn't get too low. Low humidity allows static to accumulate to dangerous levels. A humidifier goes a long way toward preventing this.
A charger probably isn't appropriate -- its function is specific for use with a battery. But a 5V "wall wart" power supply intended for powering electronics (router, cordless phone base unit, electronic picture frame etc) will be fine.
Have fun, and keep us posted!
-- Jeff
Mike is right on target re those resistors -- they're a precaution. All being well (ie, as planned, you do nothing but NOP's) they're not necessary, because NOP's only read (input from) the data bus. But "stuff happens," and it's possible you might accidentally cause a write cycle, and outputting to the data bus would cause excessive current to flow were the resistors not present. The excessive current might damage the chip, but they are surprisingly robust.
To avoid damaging your ICs your biggest concern (especially in winter) is probably ESD (static electricity). Ideally you should use a wrist strap to ground yourself but the 2nd-best solution (and one I use myself) is to always touch a grounded object before handling the project.
Quote:
Can I power my computer with a 5V 1A DC charger?
Have fun, and keep us posted!
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Newbie 6502 breadoard computer advice
Jock wrote:
Can I power my computer with a 5V 1A DC charger?
Saying that, it shouldn't damage a 65C02, but may well make it unstable. If it's your only choice then put a good capacitor at the supply input (say 47µF, 25v and check polarity) and measure the voltage with a multimeter before you power the rest of the circuit with it. A modern 65C02 plus the stuff on the Ben Eater project isn't going to consume much more than a few 10's of mA at the most, anyway, so ...
Most PSUs that are designed for the Pi and other similar boards now output 5.2v which is fine. My Ruby 816 board is currently at 4.8v because it's being powered via a USB serial line and it's working fine. (Although that supply wasn't good enough when I hooked up a 20x4 line backlit LCD panel)
One other thing to check is that they're properly isolated - especially if you're going to be poking round the board, so use a multimeter on continuity setting to make sure the positive and 0v wires are not connected to the incoming mains pins. Cheap ones are often capacitor droppers and these can be dangerous. (See https://hackaday.com/2017/04/04/the-sho ... -supplies/ and "BigClive" on YouTube for more on these) although a 5v, 1A one is probably not a capacitive dropper.
Good luck with the project - do keep us informed.
-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: Newbie 6502 breadoard computer advice
As a minor follow up to Jeff's post on powering your project....
You should provide a regulated 5-volt supply. How you do that can be one of two approaches:
1- Use a regulated wall-wart (as Jeff noted) that provides the proper current. I would recommend a supply capable of 3 amps.
2- Provide a higher, possibly unregulated, DC supply of 9-volts and use an onboard regulator to obtain the required 5-volts.
The old 7805 linear regulator has been used for decades, but there are newer switching regulator "drop-in" replacements which are more efficient.
In all cases, make sure you provide adequate bypassing for all ICs on your design, along with 2 or 3 larger value filter caps. A poly-fuse might also be a good addition for safety.
You should provide a regulated 5-volt supply. How you do that can be one of two approaches:
1- Use a regulated wall-wart (as Jeff noted) that provides the proper current. I would recommend a supply capable of 3 amps.
2- Provide a higher, possibly unregulated, DC supply of 9-volts and use an onboard regulator to obtain the required 5-volts.
The old 7805 linear regulator has been used for decades, but there are newer switching regulator "drop-in" replacements which are more efficient.
In all cases, make sure you provide adequate bypassing for all ICs on your design, along with 2 or 3 larger value filter caps. A poly-fuse might also be a good addition for safety.
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
- Firefox6502
- Posts: 44
- Joined: 01 Feb 2021
- Location: Sydney, Australia
Re: Newbie 6502 breadoard computer advice
Quote:
A charger probably isn't appropriate -- its function is specific for use with a battery. But a 5V "wall wart" power supply intended for powering electronics (router, cordless phone base unit, electronic picture frame etc) will be fine.
Reading up, apparently there are differences such as a charger may not have noise filtering or regulation, where the adapter is designed to provide clean DC voltage to power devices.
FYI... I plan to use a modern Raspberry Pi adapter (output 5.1V, 2.5A).
Greetings Professor Falken.
- Firefox6502
- Posts: 44
- Joined: 01 Feb 2021
- Location: Sydney, Australia
Re: Newbie 6502 breadoard computer advice
floobydust wrote:
As a minor follow up to Jeff's post on powering your project....
You should provide a regulated 5-volt supply. How you do that can be one of two approaches:
1- Use a regulated wall-wart (as Jeff noted) that provides the proper current. I would recommend a supply capable of 3 amps.
2- Provide a higher, possibly unregulated, DC supply of 9-volts and use an onboard regulator to obtain the required 5-volts.
The old 7805 linear regulator has been used for decades, but there are newer switching regulator "drop-in" replacements which are more efficient.
In all cases, make sure you provide adequate bypassing for all ICs on your design, along with 2 or 3 larger value filter caps. A poly-fuse might also be a good addition for safety.
You should provide a regulated 5-volt supply. How you do that can be one of two approaches:
1- Use a regulated wall-wart (as Jeff noted) that provides the proper current. I would recommend a supply capable of 3 amps.
2- Provide a higher, possibly unregulated, DC supply of 9-volts and use an onboard regulator to obtain the required 5-volts.
The old 7805 linear regulator has been used for decades, but there are newer switching regulator "drop-in" replacements which are more efficient.
In all cases, make sure you provide adequate bypassing for all ICs on your design, along with 2 or 3 larger value filter caps. A poly-fuse might also be a good addition for safety.
(I wasn't aware there were other regulator options, other than a lm317.)
Also, I understand why bypass capacitors are required for each IC, e.g. an 0.1 uF ceramic cap on Power to GND, but what are these several larger value filter capacitors you are referring to and where do these go in typical circuit? Thanks.
Greetings Professor Falken.
Re: Newbie 6502 breadoard computer advice
Firefox6502 wrote:
If I go down the 7805 regulator path, could someone please recommend a more modern drop-in replacement?
(I wasn't aware there were other regulator options, other than a lm317.)
Also, I understand why bypass capacitors are required for each IC, e.g. an 0.1 uF ceramic cap on Power to GND, but what are these several larger value filter capacitors you are referring to and where do these go in typical circuit? Thanks.
(I wasn't aware there were other regulator options, other than a lm317.)
Also, I understand why bypass capacitors are required for each IC, e.g. an 0.1 uF ceramic cap on Power to GND, but what are these several larger value filter capacitors you are referring to and where do these go in typical circuit? Thanks.
You need decoupling on the output to stop oscillation with a 7805. I good (but possibly unusual) reference site for these is Wikipedia:
https://en.wikipedia.org/wiki/78xx
-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
- Firefox6502
- Posts: 44
- Joined: 01 Feb 2021
- Location: Sydney, Australia
Re: Newbie 6502 breadoard computer advice
drogon wrote:
You need decoupling on the output to stop oscillation with a 7805. I good (but possibly unusual) reference site for these is Wikipedia: https://en.wikipedia.org/wiki/78xx
Greetings Professor Falken.
Re: Newbie 6502 breadoard computer advice
Firefox6502 wrote:
a charger may not have noise filtering or regulation, where the adapter is designed to provide clean DC voltage to power devices.
Of course you can connect an unregulated adapter to a 7805 (including capacitors, as noted). Just beware, because your logic circuits will fry if they get accidentally shorted to the comparatively high voltage at the input of the regulator.
That's why I prefer to use a regulated adapter (or a bench power supply). As long as the project itself uses 5 Volts only, there's not much risk of a chip getting damaged if I make an incorrect connection or accidentally drop a metallic tool on the circuitry.... whereas accidents like that can be fatal when the board includes voltages above 5V (likewise negative voltages, as used for some asynch serial drivers). It's safer to keep everything 5V only. You need to use extra caution if other voltages are present.
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Newbie 6502 breadoard computer advice
Thanks for advice, everybody! I have a question about Resistor Power Rating. Is it usually safer to use a resistor with higher Power Rating, so my circuit doesn't fry itself?
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: Newbie 6502 breadoard computer advice
Resistor power rating is fairly simple, here's a simple example:
Take a LED that draws 1ma of current. The typical forward voltage for the LED is 1.7 volts. Using a 5.0 volt supply, you would take 5.0 volts. minus 1.7 volts and require a 3.3 volts drop across a resistor. 3.3 volts divided by 1ma = 3.3/1000 = 3300 ohms, or 3.3K ohms. Now, take the 3.3 volts drop across the resistor and multiply it by the current through the resistor (1ma) and you get 3.3 times 0.001 = 0.0033 watts of dissipation. As resistors have standard ratings for power, a 1/8-watt resistor would be easily sufficient.
Of course, as you start ramping up power dissipation for higher loads, you should size your resistors for a comfortable margin, roughly 4-5 times the dissipation under normal operating parameters. Also, look at a worse case scenario... in the above example, if the LED shorted, you would see the entire 5.0 volts across the 3.3K resistor. That would increase the dissipation to 0.0075 watts, which is still fine. In general, for the projects most of us do here (with 5.0 volts supplies and relatively low operating current), 1/8-watt, 1/4-watt and sometimes 1/2-watt resistors will be more than sufficient. Only in cases where you need to drop a fair amount of current do you need to get into large wattage values.
Hope this helps....
Take a LED that draws 1ma of current. The typical forward voltage for the LED is 1.7 volts. Using a 5.0 volt supply, you would take 5.0 volts. minus 1.7 volts and require a 3.3 volts drop across a resistor. 3.3 volts divided by 1ma = 3.3/1000 = 3300 ohms, or 3.3K ohms. Now, take the 3.3 volts drop across the resistor and multiply it by the current through the resistor (1ma) and you get 3.3 times 0.001 = 0.0033 watts of dissipation. As resistors have standard ratings for power, a 1/8-watt resistor would be easily sufficient.
Of course, as you start ramping up power dissipation for higher loads, you should size your resistors for a comfortable margin, roughly 4-5 times the dissipation under normal operating parameters. Also, look at a worse case scenario... in the above example, if the LED shorted, you would see the entire 5.0 volts across the 3.3K resistor. That would increase the dissipation to 0.0075 watts, which is still fine. In general, for the projects most of us do here (with 5.0 volts supplies and relatively low operating current), 1/8-watt, 1/4-watt and sometimes 1/2-watt resistors will be more than sufficient. Only in cases where you need to drop a fair amount of current do you need to get into large wattage values.
Hope this helps....
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
Re: Newbie 6502 breadoard computer advice
Firefox6502 wrote:
Quote:
A charger probably isn't appropriate -- its function is specific for use with a battery. But a 5V "wall wart" power supply intended for powering electronics (router, cordless phone base unit, electronic picture frame etc) will be fine.
Reading up, apparently there are differences such as a charger may not have noise filtering or regulation, where the adapter is designed to provide clean DC voltage to power devices.
There are actually more than six types of mains voltage to low voltage output power supply units / chargers / wall warts / power adapters etc...
Some even output AC rather than DC.
And don’t be fooled by a PSU having a USB socket on it. That means nothing.
I won’t describe them all here, but basically your circuit needs a nice smooth regulated DC voltage that stays noise free and within a few percent of it’s stated value. These are known as “regulated” types. The older terminology is “stabilised”. If the unit does not say it’s regulated, assume that it’s not.
Unregulated types are the equivalent of a sea with the wind behind it, lots of high waves and the height varies all the time. Whereas a regulated type is like a carefully controlled indoor fish tank, the surface is totally smooth and flat and someone maintains the water level to the correct height.
Microprocessors don’t like DC power that is choppy. The ripple messes up their operation, especially if the voltage dips too low, as then everything resets...
And with light loads, chargers and unregulated PSUs can output much higher voltages than the labelling suggests. For example a 9V nominal unregulated DC PSU can produce up to about 16V with no load or a light load.
Mark
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Newbie 6502 breadoard computer advice
Jock wrote:
Thanks for advice, everybody! I have a question about Resistor Power Rating. Is it usually safer to use a resistor with higher Power Rating, so my circuit doesn't fry itself?
Yes. Generally speaking, the only downside to using higher wattage resistors is their larger physical size. That said, calculating the appropriate wattage rating is quite simple, so there should be no reason to go overboard.
x86? We ain't got no x86. We don't NEED no stinking x86!