6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 1:26 pm

All times are UTC




Post new topic Reply to topic  [ 72 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: My 6502 computer
PostPosted: Sun May 26, 2024 10:06 am 
Offline

Joined: Wed Apr 10, 2024 7:24 am
Posts: 50
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.

Attachment:
ViridiKeyboard.jpg
ViridiKeyboard.jpg [ 907.11 KiB | Viewed 932 times ]



Edit

I don't need that R/W pin. The Write Enable of the 28C256 is pulled high it should be read only.


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Sun May 26, 2024 6:42 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
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. :wink:

-- Jeff


Attachments:
excerpt .png
excerpt .png [ 49.17 KiB | Viewed 908 times ]

_________________
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  
 Post subject: Re: My 6502 computer
PostPosted: Mon May 27, 2024 6:53 am 
Offline

Joined: Wed Apr 10, 2024 7:24 am
Posts: 50
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.


Ah ok so it also a replacement for the flipflop. Well then it would be stupid not to replace it with your inverter-based alternative. It would be a shame to add IC's if it is not needed. I already needed an inverter and this way I can make use more inverters on the chip. I don't understand entirely how this circuit works, perhaps you can elaborate a bit on that?

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.


After thinking about it I think it is a better option to have the reset circuit on the board with the 65xx chips I could add a simple reset button on there as well in case I want to test the board. Otherwise I always need to connect the keyboard to be able to reset it.

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.


The whole idea behind this putting it on my keyboard is the I want to build a 3d printed case around the computer and keyboard. If I put it on top of the keyboard I don't have to open it every time to reprogram the EEPROM. I want to be able to reuse the keyboard so I thought I could add a ZIF to it as well so I can reuse the case and the keyboard.

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. :wink:

-- Jeff


Ah yes I see :? and yes I will double check everything. I just put something together quickly to discuss the idea and to get valuable feedback for the project. And you guys already gave a lot of that thanks a lot.

I will be doing some breadboarding and soldering on a perfboard as well to check if everything works the way I expect.


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Mon May 27, 2024 9:55 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 983
Location: Potsdam, DE
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


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Mon May 27, 2024 11:48 am 
Offline

Joined: Wed Apr 10, 2024 7:24 am
Posts: 50
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


Thank you for your feedback 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.


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 10:47 am 
Offline

Joined: Wed Apr 10, 2024 7:24 am
Posts: 50
Jeff, posted this schematic:

Attachment:
bounceless switch.png
bounceless switch.png [ 2.88 KiB | Viewed 830 times ]


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?


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 11:27 am 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 257
Location: Texas
viridi wrote:
Jeff, posted this schematic:

Attachment:
bounceless switch.png


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?


The voltage is given on the VCC/GND pins of the 74xx14, the first inverter in the series will start out normally high, which will charge, the cap.


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 12:02 pm 
Offline

Joined: Wed Apr 10, 2024 7:24 am
Posts: 50
Yuri wrote:
viridi wrote:
Jeff, posted this schematic:

Attachment:
bounceless switch.png


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?


The voltage is given on the VCC/GND pins of the 74xx14, the first inverter in the series will start out normally high, which will charge, the cap.


Ok I understand.
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 12:33 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1117
Location: Albuquerque NM USA
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


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 1:00 pm 
Offline

Joined: Wed Apr 10, 2024 7:24 am
Posts: 50
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


Hi Bill, thanks for the explanation.
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 2:49 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
viridi wrote:
I see a switch in the schematic but it is not tied to Vcc anywhere.
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.
Attachment:
detail a.png
detail a.png [ 2.59 KiB | Viewed 794 times ]


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.
Attachment:
detail b.png
detail b.png [ 3.94 KiB | Viewed 794 times ]


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

_________________
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  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 4:26 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
really nice debouncer! and adds no delay, unlike some (software) approaches


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 4:57 pm 
Offline
User avatar

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


Top
 Profile  
Reply with quote  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 5:52 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
BigEd wrote:
really nice debouncer! and adds no delay, unlike some (software) approaches
Thanks, Ed. I didn't invent this circuit, but at least I managed to remember it! :P As for adding no delay, that attribute is shared by the debounce circuits I posted here... but these all have the disadvantage of requiring a switch with both Normally Open and Normally Closed contacts.

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.
No, not with the R and C values shown. But with different component values, 74LS or even <shudder> Standard 7400 Series TTL could probably be coaxed to work. It's just that the values would be much less forgiving, making it hard to justify the necessary fussing! :roll:

-- Jeff


Attachments:
with reset.png
with reset.png [ 1.75 KiB | Viewed 776 times ]

_________________
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  
 Post subject: Re: My 6502 computer
PostPosted: Tue May 28, 2024 6:36 pm 
Offline

Joined: Wed Apr 10, 2024 7:24 am
Posts: 50
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.
Attachment:
detail a.png


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.
Attachment:
detail b.png


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 was partly clear to me, but now I completely understand it. Thanks for the clear explanation 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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 72 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

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: