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.
Hi BigDumbDinosaur, yes I understand it was just that the simulation software I tried did not have the functionality to simulate this circuit properly. But after Jeff's great explanation I don't have to anymore .
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!
Yeah, I should have clarified that it is the R-C values that make the circuit incompatible with 74LS logic.
Speaking of 7400-series logic, the ZIP mail translators that I worked on way back when (1970) were almost all 7400 logic. Those things gobbled up a ton of power and pumped out heat like a pizza oven. I cannot fathom why anyone would use that stuff today.
I have a 74HC245 in my schematic to output the 8-bits from the keyboard. I connected the direction pin to the OUT signal (pin 5 from the 74151) that is a mistake I can just pull that high so that the direction always goes from A to B. I can connect pin 5 from the 74151 to the CE pin via an inverter to enable the chip if a key is pressed.
Is this the way to go? The OUT signal is also send to the W65C22 (CA1 or CA2). Do I need the 74HC245 at all or can I just hook up the 8 bits straight to the W65C22?
Another option is to use And gates that output the 8 bits if the the OUT signal is high (bit 1 AND OUT etc.). But then I need 2 chips instead of one.
What do you guys think is best? Perhaps there is even a better solution I did not think of.
*edit
I'm not sure if this is a problem but maybe these bits need to stay on the bus for a while? I can imagine that if the clock pulses the data is gone before the 6522 had time to process the date. Or wil it be fast enough to read the data before going to the next column/row?
*edit 2
I need to read the datasheet and the timing diagrams in there before asking. I try to understand it, in case I don't I will get back to ask questions.
Ok, I have had a read and I think I need Read Handshake Control for the 65C22 to read in the data from the keyboard.
The datasheet tells about the Read Handshake, the Read Handshake signals the 65C22 that data is ready on the peripheral port this is done by sending a signal to the CA1 interrupt input pin. So I need to be sure that the data is available before sending this signal. The 65C22 sends a 'Data Taken' signal back via the CA2 pin when the 65C02 reads the data.
This does answer my question unless I did not understand it well. But then I need to figure out how to accomplish this. I could add a latch (the 74573?) to keep the data active until I get the 'Data Taken' signal back from the 65C22. The OUT signal in my schematics will be high and then the keyboard outputs data from the 4-bit counters and the shift/control somehow. So I can't use that as a signal to the CA1 pin I guess? So I need to trigger a signal after the content is in the latch.
If I use the 74573 I need to keep the output enable low until the 65C22 sends the 'Data Taken' signal somehow.
Did I understand everything correctly? And what are the steps to take to get the timing right?
Do I need Read Handshake Control at all? Or can I just use the CA1 pin to trigger an interrupt and let the CPU fetch the value from port A of the 65C22? In that case I still need to hold the value for a while via a latch?
I was thinking about this. If I keep one port dedicated to the keyboard. I can always output the control/shift and clock values. Then I would be able to use the OUT as a strobe signal. Would this work?
Or is there a better way to do it?
I wonder why I don't get an answer to my questions. Perhaps my question is not clear. What I want to know is the following.
If I put data on port A of my 65c22S and then send the OUT signal coming from the 74HC151 (Y) when a key is pressed to CA1. Is this enough for the 65c22S to be able to read the data from port A? Or will there be timing issues? Or do I need extra circuitry to be able to pull it off?
I think the CA1 input can cause an interrupt, and your service routine can then read Port A. That will be some time later, so no need to worry that the data won't be ready. But you do need to ensure the data will still be there. I don't think the 6522 automatically latches data on the parallel interfaces - but check the datasheet to be sure.
When reading the Peripheral Port (PA or PB), the contents of the corresponding Input Register (IRA or IRB)
is transferred onto the Data Bus. When the input latching feature is disabled, IRA will reflect the logic levels
present on the PA bus pins. However, with input latching enabled and the selected active transition on
Peripheral A Control 1 (CA1) having occurred, IRA will contain the data present on the PA bus lines at the
time of the transition. In this case, once IRA has been read, it will appear transparent, reflecting the current
state of the PA bus pins until the next CA1 latching transition.
The two 3-bit counters control the 74238 and the 74151. The output of these counters will be at port A. The Y output of the 74151 will be the strobe signal to the CA1 this will happen if the user pressed a key. So the strobe will happen when the values of the counters will already be on port A. I guess I just need to test it on a breadboard/perfboard to see if it works.
It has been a while. I found some time to do some work on my computer. We havent talked about my computer so far only about the keyboard. I designed a schematic of the computer I want to build. I said that I want to add game controllers, video and sound outputs to my computer but I think it would be better to start with creating a SBC first with the possibility to connect external hardware with separate boards later. If everything works I could create a new board later with everything on a single board if needed.
I have added the schematic I have so far in this attachment:
If you guys have improvements or suggestions I love to hear it.
Btw Kicad is complaining about 'Input pins not driven by any Output pins' on the RS0..RS3 pins of both the 65C22's. And 'Pins of type Output and Output are connected' on both the _IRQ_ pins of the 65C22's. Does anyone know how to fix this issues?
The VIA register select inputs are connected to signals A0-3 while all others seem to be connected to Addr0-3.
Also, the (modern) VIA's /IRQ output is totem pole. Connecting them together may result in short circuits through the chips. You need to add a diode to each VIA /IRQ output so the VIAs pull the interrupt line low but don't drive them high (it needs a pullup in that case)
André
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
The VIA register select inputs are connected to signals A0-3 while all others seem to be connected to Addr0-3.
Also, the (modern) VIA's /IRQ output is totem pole. Connecting them together may result in short circuits through the chips. You need to add a diode to each VIA /IRQ output so the VIAs pull the interrupt line low but don't drive them high (it needs a pullup in that case)
André
Ah great thanks André these adjustments fix the issues.
Here is a new version of the schematic.
I finally found some time to play around a bit. I created a breadboard with a shift and a caps lock button. I already use a 7486 IC (quad xor gate) to determine if the shift output should be high or low based on the shift and caps lock buttons. So I decided to remove the hex inverter IC and use 2 more of the xor gates as inverters by binding one of the pins of both gates high, this saves an IC. I tested it and it works!
The VIA register select inputs are connected to signals A0-3 while all others seem to be connected to Addr0-3.
Also, the (modern) VIA's /IRQ output is totem pole. Connecting them together may result in short circuits through the chips. You need to add a diode to each VIA /IRQ output so the VIAs pull the interrupt line low but don't drive them high (it needs a pullup in that case)
André
Ah great thanks André these adjustments fix the issues.
Here is a new version of the schematic.
In my schematic I use a 7414 hex schmitt-trigger inverter for my reset circuit like GARTHWILSON suggests on his website. I also use some of the other inverters on this chip for my address decoding logic. I also have a 7400 quad 2-input NAND gate in my schematic. What if I use a 74132 Quad Schmitt Trigger NAND Gate instead (a NAND gate could be used as an inverter). Would this work as well? I can just use this single 74132 chip to replace the 7414 and the 7400 chips.