My 6502 computer
Re: My 6502 computer
did not have an answer yet on my question about the reset circuit. Is it ok to put it on the keyboard pcb and connect it to the pcb that has the 65Cxx chips? Or does it need to be on the pcb with the 65Cxx chips?
I also want to add the EEPROM on the keyboard pcb to have it on top of my computer via a ZIF socket so I can easily take it out and reprogram it (and to be able to reuse the whole board in a (cough) Z80 (cough) based computer I would like to build someday). So I need a bigger connector to the keyboard pcb. I have read that it is a good practice to add more ground wires to reduce noice. Is this correct? If so what is the correct place to add them? I could add a 40 2x20 pin connector. I would need 25 pins for the 28c256 I have and then I need the 13 pins for the keyboard one of these is ground already so I would have 3 ground pins. Would that be enough?
Edit
Here is another version of the schematic. I added the idea of adding the EEPROM and also some bypass capacitors.
Edit
I don't need that R/W pin. The Write Enable of the 28C256 is pulled high it should be read only.
I also want to add the EEPROM on the keyboard pcb to have it on top of my computer via a ZIF socket so I can easily take it out and reprogram it (and to be able to reuse the whole board in a (cough) Z80 (cough) based computer I would like to build someday). So I need a bigger connector to the keyboard pcb. I have read that it is a good practice to add more ground wires to reduce noice. Is this correct? If so what is the correct place to add them? I could add a 40 2x20 pin connector. I would need 25 pins for the 28c256 I have and then I need the 13 pins for the keyboard one of these is ground already so I would have 3 ground pins. Would that be enough?
Edit
Here is another version of the schematic. I added the idea of adding the EEPROM and also some bypass capacitors.
Edit
I don't need that R/W pin. The Write Enable of the 28C256 is pulled high it should be read only.
Re: My 6502 computer
I don't see any reason why the 74x74-based Caps Lock flipflop can't be replaced with the inverter-based alternative, and I don't think it matters whether it's on the same PCB or not. So, that's a question that can be determined by your own preference and by matters of practicality.
I hesitate to endorse the idea of relocating the ZIF socket for the EEPROM. That's a lot of address and data lines that would have to be brought to the keyboard PCB, which means additional connectors which in turn means higher cost and lower reliability... Simplicity is better, IMO.
I do understand the urge to customize a project, which is part of the enjoyment of the hobby. So, it's your own decision. But if you wanna re-use the ZIF socket in a future project, you could instead consider plugging into a regular IC socket which in turn is soldered to the PCB. IOW, don't solder the ZIF at all.
BTW I found another error just by a very quick glance at your schematic, so maybe you need to give the whole thing a careful going over.
-- Jeff
I hesitate to endorse the idea of relocating the ZIF socket for the EEPROM. That's a lot of address and data lines that would have to be brought to the keyboard PCB, which means additional connectors which in turn means higher cost and lower reliability... Simplicity is better, IMO.
I do understand the urge to customize a project, which is part of the enjoyment of the hobby. So, it's your own decision. But if you wanna re-use the ZIF socket in a future project, you could instead consider plugging into a regular IC socket which in turn is soldered to the PCB. IOW, don't solder the ZIF at all.
BTW I found another error just by a very quick glance at your schematic, so maybe you need to give the whole thing a careful going over.
-- 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: My 6502 computer
Dr Jefyll wrote:
I don't see any reason why the 74x74-based Caps Lock flipflop can't be replaced with the inverter-based alternative.
I'm not sure but perhaps I can find more opportunities to reduce the amount of IC's in the design.
I have used a 74HC245 in there and I control the output via the port direction pin. I don't think that is a good idea either.
I could replace that with simple OR gates there are more logic chips in there perhaps I could reduce the amount of IC's by combining things.
Dr Jefyll wrote:
I don't think it matters whether it's on the same PCB or not.
Dr Jefyll wrote:
I hesitate to endorse the idea of relocating the ZIF socket for the EEPROM. That's a lot of address and data lines that would have to be brought to the keyboard PCB, which means additional connectors which in turn means higher cost and lower reliability... Simplicity is better, IMO.
I do understand the urge to customize a project, which is part of the enjoyment of the hobby. So, it's your own decision. But if you wanna re-use the ZIF socket in a future project, you could instead consider plugging into a regular IC socket which in turn is soldered to the PCB. IOW, don't solder the ZIF at all.
I do understand the urge to customize a project, which is part of the enjoyment of the hobby. So, it's your own decision. But if you wanna re-use the ZIF socket in a future project, you could instead consider plugging into a regular IC socket which in turn is soldered to the PCB. IOW, don't solder the ZIF at all.
Dr Jefyll wrote:
BTW I found another error just by a very quick glance at your schematic, so maybe you need to give the whole thing a careful going over.
-- Jeff
-- Jeff
I will be doing some breadboarding and soldering on a perfboard as well to check if everything works the way I expect.
Re: My 6502 computer
As your reset circuit is drawn, the output of the inverter is normally high - what you need.
But... with the resistor values you've drawn, closing the switch will take the voltage at the input to the inverter only to half the supply voltage. This is not necessarily going to push the inverter output to one level or the other; it may oscillate, it may just float around half rail... generally something you're not expecting. Half rail inputs on CMOS parts are *never* a good idea; the gate (particularly that one!) will operate in the linear region. Good for making oscillators, not good for making clean signals.
You can safely remove the resistor R1 and drive the switch directly from the Vcc rail. You might consider replacing the HC04 with an HC14 with Schmidt trigger input to provide a little more noise immunity; you can use its gates normally (as HC04) elsewhere in the circuit if they meet your speed requirements.
Neil
But... with the resistor values you've drawn, closing the switch will take the voltage at the input to the inverter only to half the supply voltage. This is not necessarily going to push the inverter output to one level or the other; it may oscillate, it may just float around half rail... generally something you're not expecting. Half rail inputs on CMOS parts are *never* a good idea; the gate (particularly that one!) will operate in the linear region. Good for making oscillators, not good for making clean signals.
You can safely remove the resistor R1 and drive the switch directly from the Vcc rail. You might consider replacing the HC04 with an HC14 with Schmidt trigger input to provide a little more noise immunity; you can use its gates normally (as HC04) elsewhere in the circuit if they meet your speed requirements.
Neil
Re: My 6502 computer
barnacle wrote:
As your reset circuit is drawn, the output of the inverter is normally high - what you need.
But... with the resistor values you've drawn, closing the switch will take the voltage at the input to the inverter only to half the supply voltage. This is not necessarily going to push the inverter output to one level or the other; it may oscillate, it may just float around half rail... generally something you're not expecting. Half rail inputs on CMOS parts are *never* a good idea; the gate (particularly that one!) will operate in the linear region. Good for making oscillators, not good for making clean signals.
You can safely remove the resistor R1 and drive the switch directly from the Vcc rail. You might consider replacing the HC04 with an HC14 with Schmidt trigger input to provide a little more noise immunity; you can use its gates normally (as HC04) elsewhere in the circuit if they meet your speed requirements.
Neil
But... with the resistor values you've drawn, closing the switch will take the voltage at the input to the inverter only to half the supply voltage. This is not necessarily going to push the inverter output to one level or the other; it may oscillate, it may just float around half rail... generally something you're not expecting. Half rail inputs on CMOS parts are *never* a good idea; the gate (particularly that one!) will operate in the linear region. Good for making oscillators, not good for making clean signals.
You can safely remove the resistor R1 and drive the switch directly from the Vcc rail. You might consider replacing the HC04 with an HC14 with Schmidt trigger input to provide a little more noise immunity; you can use its gates normally (as HC04) elsewhere in the circuit if they meet your speed requirements.
Neil
My intention was to use the same reset circuit as mentioned by Garth Wilson at https://wilsonminesco.com/6502primer/RSTreqs.html (the second option using 74HC14) but I made a mistake. The resistor going to VCC but should be going to ground. I already corrected that but I did not post a new version of the schematic. I think I have only used HC14 (Schmidt trigger) inverters in my schematic.
I will need to check most of the resistors and capacitors values they might be incorrect. I just quickly copy pasted them around. I should have hidden the values for until I figured that out.
Re: My 6502 computer
Jeff, posted this schematic:
I try to understand how this all works so I want to put it together in a simulator so I can see what happens. But where do I put the supply voltage?
I try to understand how this all works so I want to put it together in a simulator so I can see what happens. But where do I put the supply voltage?
Re: My 6502 computer
viridi wrote:
Jeff, posted this schematic:
I try to understand how this all works so I want to put it together in a simulator so I can see what happens. But where do I put the supply voltage?
I try to understand how this all works so I want to put it together in a simulator so I can see what happens. But where do I put the supply voltage?
Re: My 6502 computer
Yuri wrote:
viridi wrote:
Jeff, posted this schematic:
I try to understand how this all works so I want to put it together in a simulator so I can see what happens. But where do I put the supply voltage?
I try to understand how this all works so I want to put it together in a simulator so I can see what happens. But where do I put the supply voltage?
I just want to visualize what happens so I'm trying to build it in a simulator like https://www.falstad.com/circuit/circuitjs.html. The problem is it only has inverters as gates not a 7414 chip.
Re: My 6502 computer
The 2 inverters and 47K forms a flip flop to denounce the switch. The common denounced high/low circuit is done with single pole double throw switch with one pole tied to ground and other pole tied to Vcc. The clever part of the circuit is the 470K from inverted gate charging the 0.1uF cap. The time constant is long enough to filter out switch bounce, but still allow the switch to change state with every button press.
Bill
Bill
Re: My 6502 computer
plasmo wrote:
The 2 inverters and 47K forms a flip flop to denounce the switch. The common denounced high/low circuit is done with single pole double throw switch with one pole tied to ground and other pole tied to Vcc. The clever part of the circuit is the 470K from inverted gate charging the 0.1uF cap. The time constant is long enough to filter out switch bounce, but still allow the switch to change state with every button press.
Bill
Bill
Jeff, mentions a momentary pushbutton, how would that work? I plan to use Cherry MX switches these are momentary single pole switches. I see a switch in the schematic but it is not tied to Vcc anywhere.
Re: My 6502 computer
viridi wrote:
I see a switch in the schematic but it is not tied to Vcc anywhere.
How the circuit works:
It's maybe best to start by pointing out that the two inverters are connected to act as a memory (aka, a flip-flop). If the output happens to be high then it will stay high, and if it happens to be low then it will stay low. These two possible circumstances are shown in the diagram below. (As you can see, I've stripped away the other components.) When the other components are added we can see that the capacitor will slowly (ie; about 50 ms, because of the large resistance) charge or discharge until the capacitor is in the opposite state compared to the input of the first inverter.
During the time the button remains pressed, the capacitor and the input of the first inverter will be in agreement rather than opposition. The cap won't appreciably charge or discharge because during this time it is influenced primarily by the small, 47K resistor. But when the button is released, then the large, 470K resistor will slowly cause the capacitor to update until it's once again in opposition, ready for the following button-push. And this slowness is what gives the circuit its immunity to contact bounce.
BTW, the circuit as shown is intended for use with inverters (or inverting gates such as NAND or NOR) from one of the CMOS families, for example the 74HC family, 74AHC, or, with caveats, even the old 4000 CMOS family. Inverters/gates which have Schmitt-trigger inputs are also acceptable (or maybe even slightly preferred, as the Schmitt-trigger inputs will avoid the small, theoretical risk that the circuit might falter on a tiny minority of the button-pushes.)
As for logic families such as 74HCT and 74LS, these are not very good choices -- it's doubtful whether they can be coaxed to work. I can't say for sure it's impossible, but I am sure it would require some expert tinkering to modify the circuit.
-- Jeff
Last edited by Dr Jefyll on Sun Jul 20, 2025 2:48 pm, edited 2 times in total.
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: My 6502 computer
really nice debouncer! and adds no delay, unlike some (software) approaches
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: My 6502 computer
viridi wrote:
Jeff, posted this schematic...I try to understand how this all works so I want to put it together in a simulator so I can see what happens. But where do I put the supply voltage?
In DIP or SOIC packages of the 74HC04, pin 7 is ground and pin 14 is VCC. Ditto for the 74HC14, which is what I recommend you use.
Note that this debouncer may power up in an indeterminate state due to the likelihood that the propagation delay through the two inverters will be unequal. Also, note Jeff’s caution about using CMOS logic—it will not work with 74LS inverters.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: My 6502 computer
BigEd wrote:
really nice debouncer! and adds no delay, unlike some (software) approaches
Regarding the power-up state of the circuit at hand, I'm not sure I follow Yuri's reasoning, or BDD's either, (even acknowledging that the cap will initially be discharged). But I do lean toward BDD's conclusion, at least -- ie, that the power-up state is not predictable. In any case, it could certainly be made predictable by including a connection to the system's reset circuit as Yuri suggested. (A diode would be required, as shown below.)
BigDumbDinosaur wrote:
Also, note Jeff’s caution about using CMOS logic—it will not work with 74LS inverters.
-- Jeff
- Attachments
-
- with reset.png (1.75 KiB) Viewed 4964 times
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: My 6502 computer
Dr Jefyll wrote:
Right. VCC and GND go to the supply pins of the inverter IC (as Yuri said), but in this circuit they don't attach to the switch.
It's maybe best to start by pointing out that the two inverters are connected to act as a memory (aka, a flip-flop). If the output happens to be high then it will stay high, and if it happens to be low then it will stay low. This is shown below. When the other components are added we can see that the capacitor will slowly (ie; about 50 ms, because of the large resistance) charge or discharge until it is in the opposite state compared to the input of the first inverter.
And the circuit will remain in this condition until the button is pushed.
When the button is pushed, the high or low state of the capacitor gets applied to the input of the first inverter, causing the memory aka flipflop to go high if it was low, or go low if it was high. (The cap momentarily overpowers the influence of the 47K resistor; then the flip-flop changes state and the resistor no longer needs to be overpowered.)
Now the capacitor and the input of the first inverter are in agreement rather than opposition. The cap won't appreciably charge or discharge because during this time it is influenced primarily by the small, 47K resistor. But when the button is released, then the large, 470K resistor will slowly cause the capacitor to update until it's once again in opposition, ready for the following button-push. And this slowness is what gives the circuit its immunity to contact bounce.
BTW the inverter needs to be a CMOS type (ie, from the 74HC family, for example, NOT 74LS etc). An ordinary 74HC04 will work reasonably well, but on a tiny minority of button-pushes the circuit might falter. If that's not tolerable then use a 74HC14, for example, whose Schmitt trigger feature will ensure that output transitions always have crisp rise and fall times.
-- Jeff
It's maybe best to start by pointing out that the two inverters are connected to act as a memory (aka, a flip-flop). If the output happens to be high then it will stay high, and if it happens to be low then it will stay low. This is shown below. When the other components are added we can see that the capacitor will slowly (ie; about 50 ms, because of the large resistance) charge or discharge until it is in the opposite state compared to the input of the first inverter.
Now the capacitor and the input of the first inverter are in agreement rather than opposition. The cap won't appreciably charge or discharge because during this time it is influenced primarily by the small, 47K resistor. But when the button is released, then the large, 470K resistor will slowly cause the capacitor to update until it's once again in opposition, ready for the following button-push. And this slowness is what gives the circuit its immunity to contact bounce.
BTW the inverter needs to be a CMOS type (ie, from the 74HC family, for example, NOT 74LS etc). An ordinary 74HC04 will work reasonably well, but on a tiny minority of button-pushes the circuit might falter. If that's not tolerable then use a 74HC14, for example, whose Schmitt trigger feature will ensure that output transitions always have crisp rise and fall times.
-- Jeff
Btw I wil use only 74HC variants of all the IC's in this project. They can all be found easily so that's great.