Posted: 12 Oct 2018, 01:21
Yes, that will do. Again, make sure that this is made 0.8 mm thick. The zip file attached can be send directly to any PCB manufacturer. Shipping will likely be more expensive than the boards themselves.
mechanical keyboard authority
https://ns1.deskthority.net/
I dunnot about BLE, haven't touched keyboards in like 3 months. Work, y'know
Yes. There are 8 rows - 2.0, 2.3, 2.4, 2.5..
Those are rows. Can only be 8 of those.
You'll need xwhatsit solenoid daughterboard for actual driving, but this board can control it.
No, it's a small boost converter + triggering circuit. So I doubt you can handwire that
Probably because BL comes before BO. Otherwise you'll be at Bootloader.Luns wrote: 02 Apr 2019, 06:31 I've downloaded Cypress PSoC Creator and had a look at what I'd downloaded of the CommonSense design. It seems to open the BLE01_USB project while I wasn't looking for a Bluetooth design per-se, but I'll presume how the capacitive matrix is handled is independent of the host interface.
Just turn on your scope and see for yourself. I'm not forcing anybody to use any particular controller.Luns wrote: 02 Apr 2019, 06:31My gut feeling is that the IBM/Xwhatsit arrangement may perform a little better: the sensing side of things is of course more sensitive to things, and a larger 24-input mux is sure to have more parasitics.
It kind of doesn't matter. What matters is 3us you must wait for things to stabilize before you read them out, and another 3-10 (depends on amount of ambient noise) for matrix to discharge. Readouts take 1us* per pin.Luns wrote: 02 Apr 2019, 06:31Also, I think IBM's sense board layouts allow for more parasitic capacitance from the column lines to the surrounding ground ring, since cap there isn't a problem with the driver outputs to push them around. On the other hand, IBM's sense lines are shared between more keys and have more capacitance from the other inactive keys, and maybe this is the worse effect.
I recall spending a month on this (actually, those are two related problems). Page 3 or 4 of this topic IIRC. I solved this in a different way - I'm sure you can see how if you look at TopDesign.cysch a bit closer (or at comments in scan module).Luns wrote: 02 Apr 2019, 06:31Another simple thing I'm seeing is with regard to the ADC input. I recall reading some complaints about the input of the ADC carrying over some memory of prior samples and corrupting new conversions. This being the case, I'm wondering, why not put an op-amp follower between the mux and the ADC? Assuming the op-amp isn't too crappy, this should quiet things a bit by completely isolating the cap matrix from any ADC kickback. I think it might also show that the memory of prior samples to be in the keyboard matrix itself rather than the ADC, but I'll need to think some more about that.
I'm too cheap for that shit. Diodes. Resistors. You need to pay for those things! Seriously though - show me an op-amp with zero input capacitance. I want to see that miracle.Luns wrote: 02 Apr 2019, 06:31That said, I think I would insert the op-amp as a TIA instead, bringing the output and inverting inputs out to pins to attach an external integrating capacitor (and maybe a bleed resistor, and level-restore diode). I think this would bring things closer to IBM's design.
If it changes - your discharge delay is too short.Luns wrote: 02 Apr 2019, 06:31how the numbers look when multiple keys are being pressed together. More specifically, for a particular key of interest, how does its min/max range change when all other keys on the same sense line (column?) are pressed simultaneously.
Why would it? It's not like you have shortage of charge carriers in a driving line. And if you don't - those are just caps connected in parallel. Each with it's own RC constant.Luns wrote: 02 Apr 2019, 06:31Depending on the on/off capacitance ratio, it's possible that with enough keys pressed, none of them would actually get seen if the decision thresholds were set based on single-key presses (for type-F.. shouldn't be an issue with beamspring). In this regard, the drive few/sense many arrangement is probably a good thing.
I intend to! Just waiting for my Cypress prototyping kit to show up.DMA wrote: 04 Apr 2019, 02:04Just turn on your scope and see for yourself. I'm not forcing anybody to use any particular controller.Luns wrote: 02 Apr 2019, 06:31My gut feeling is that the IBM/Xwhatsit arrangement may perform a little better: the sensing side of things is of course more sensitive to things, and a larger 24-input mux is sure to have more parasitics.![]()
So the switch to driving rows was to reduce the number of drive transitions, and the time associated with each one. I see. I'm not too hung up on scan rates, and my thinking was still along the lines of keeping to how IBM did things. _red_ showed a plot of the column drive of his F122 pulsing 8 times for 8 rows in about 700us, which works out to a scan rate of about 60Hz - two orders of magnitude slower than what you got, but still quite adequate. I'm sure IBM's scan rate was limited by what the microcontrollers of the day (8048 I think) could do rather than analog issues. With one pulse per key, there's no difference in number of pulses whether you drive rows or drive columns.DMA wrote: 04 Apr 2019, 02:04It kind of doesn't matter. What matters is 3us you must wait for things to stabilize before you read them out, and another 3-10 (depends on amount of ambient noise) for matrix to discharge. Readouts take 1us* per pin.Luns wrote: 02 Apr 2019, 06:31Also, I think IBM's sense board layouts allow for more parasitic capacitance from the column lines to the surrounding ground ring, since cap there isn't a problem with the driver outputs to push them around. On the other hand, IBM's sense lines are shared between more keys and have more capacitance from the other inactive keys, and maybe this is the worse effect.
So yeah, can drive columns, it just will be 2 times slower for 8x16 and about 6 times for 4x23. Which is still not bad - 8x16 is scanned at about 3.6kHz, 4x23 - 7.7kHz. But why would I?
First versions used dual-ADC (limiting them to 56 series and above) - but I found shaving 16-24us per row not worth it, because 56 series was like $2 more expensive. I already can debounce in 1 USB tick, why bother.
Yes, I'm aware of your method of measuring ground. I suggested the OpAmp having found it in PSoC designer looking at TopDesign.cysch. If you skip it in order to use a cheaper chip, then fair enough. The chip in the CY8CKIT-059 has two opamps, so in the context of using that kit, the only reason I can see to not use the opamp is if it's been tried and showed no benefit. However, I'd expect its input capacitance to be way smaller than the ADC's own input, and it may free you from the alternate ground sampling - this would let you double your scan rate.DMA wrote: 04 Apr 2019, 02:04I recall spending a month on this (actually, those are two related problems). Page 3 or 4 of this topic IIRC. I solved this in a different way - I'm sure you can see how if you look at TopDesign.cysch a bit closer (or at comments in scan module).Luns wrote: 02 Apr 2019, 06:31Another simple thing I'm seeing is with regard to the ADC input. I recall reading some complaints about the input of the ADC carrying over some memory of prior samples and corrupting new conversions. This being the case, I'm wondering, why not put an op-amp follower between the mux and the ADC? Assuming the op-amp isn't too crappy, this should quiet things a bit by completely isolating the cap matrix from any ADC kickback. I think it might also show that the memory of prior samples to be in the keyboard matrix itself rather than the ADC, but I'll need to think some more about that.
Hint: drive modes for pins _do_ matter. OEs too.
Another thing is 5267 doesn't have op-amps. and 5467 is a bit more expensive.
Both the diodes and resistors, I have plenty of kicking around, and literally cost a penny a piece. I'm willing to spend 2 cents if it yields a better design. So far as the input capacitance, it doesn't need to be zero to be an improvement, it only needs to be less than the ADC.DMA wrote: 04 Apr 2019, 02:04I'm too cheap for that shit. Diodes. Resistors. You need to pay for those things! Seriously though - show me an op-amp with zero input capacitance. I want to see that miracle.Luns wrote: 02 Apr 2019, 06:31That said, I think I would insert the op-amp as a TIA instead, bringing the output and inverting inputs out to pins to attach an external integrating capacitor (and maybe a bleed resistor, and level-restore diode). I think this would bring things closer to IBM's design.
I think you're thinking of the opposite of what I was suggesting. If you press all the keys on the same drive line, the extra capacitance the one driver needs to discharge is more and requires the longer discharge delay. What I'm more concerned about is all keys on the sense lineDMA wrote: 04 Apr 2019, 02:04If it changes - your discharge delay is too short.Luns wrote: 02 Apr 2019, 06:31how the numbers look when multiple keys are being pressed together. More specifically, for a particular key of interest, how does its min/max range change when all other keys on the same sense line (column?) are pressed simultaneously.
Actually, for the homebrew key grid, I wonder how much putting a sheet of aluminum foil behind it might help. I suspect your glitching is getting picked up inductively, and having the adjacent metal shield would allow eddy currents to flow that would cancel the glitches.DMA wrote: 04 Apr 2019, 02:04 If you remove ALL the ground traces between rows and columns - you'll see some crosstalk between columns.
Now if you have a LED-compatible dimmer at 50% in 2 meter radius, you'll see some interesting effects when scanning full-speed (matrix monitor mode slows things down considerably because scan module talks to USB and triggers rows at much slower rate - so you won't see them there) - but debouncing at 4 mostly takes care of that.
download/file.php?id=50370 - this caused me to change max debounce to 16.
Again, I think you're thinking of extra cap on the drive line; my concern is sense. I don't think I've yet seen a reasonably complete analysis of what goes on with the cap matrix yet - there's usually talk of going from voltage to current, then things kinda wander into some vague notion of signals before ending up back at voltages without making a proper transition back. So, here goes:DMA wrote: 04 Apr 2019, 02:04Why would it? It's not like you have shortage of charge carriers in a driving line. And if you don't - those are just caps connected in parallel. Each with it's own RC constant.Luns wrote: 02 Apr 2019, 06:31Depending on the on/off capacitance ratio, it's possible that with enough keys pressed, none of them would actually get seen if the decision thresholds were set based on single-key presses (for type-F.. shouldn't be an issue with beamspring). In this regard, the drive few/sense many arrangement is probably a good thing.
I guess one consideration would be the limited bandwidth of the op-amp: it may not be fast enough to follow the mux output in time for the ADC sampler.Luns wrote: 02 Apr 2019, 06:31 This being the case, I'm wondering, why not put an op-amp follower between the mux and the ADC?
It was like.. seventies. 5267 is somewhere around base S370 on the RAM front and faster than most if not all of the family. Tradeoffs were different and much more attention was paid to design - like every column on that model F PCB is impedance-matched with GPIO it's driven by. I just underdrive things and pretend I'm not violating the spec by pulling down the pins which might have negative voltage on them soon. And then it's like not negative voltage, just some current to source.
I'm not measuring ground. I'm draining the sampling cap. Don't even read the results - second stage DMA skips over them.
5888 has 4 OpAmps, 4 comparators and 4 programmable blocks that can be told to be TIAs. I simply haven't seen a single reason to use them.Luns wrote: 02 Apr 2019, 06:31the only reason I can see to not use the opamp is if it's been tried and showed no benefit.
There's this thing. It's called "manufacturability". You're not helping that by adding parts.Luns wrote: 02 Apr 2019, 06:31Both the diodes and resistors, I have plenty of kicking around, and literally cost a penny a piece. I'm willing to spend 2 cents if it yields a better design.
OH WAI. TIA has zero input impedance. That's what killed DPH (well, actually it was the desire to maintain baseline voltage between zero and +5V - but the same thing conceptually.). Inability to store charge. You're forced to measure at a specific moment in time - very, very short moment. This just doesn't work.Luns wrote: 02 Apr 2019, 06:31The catch with doing this is that you'd need to strobe the drive line once per key as IBM did. Either that, or have a separate op-amp for each sense line as was done with the DPH design.
In theory, part of the charge that got to the sense line must spill to ground via other keys in the column. In practice it's probably offset by larger capacitance of the resulting system or something like that. Not noticeable.Luns wrote: 02 Apr 2019, 06:31 I think you're thinking of the opposite of what I was suggesting. If you press all the keys on the same drive line, the extra capacitance the one driver needs to discharge is more and requires the longer discharge delay. What I'm more concerned about is all keys on the sense line
Grounded - tremendously. Floating will make noise unbearable.Luns wrote: 02 Apr 2019, 06:31 Actually, for the homebrew key grid, I wonder how much putting a sheet of aluminum foil behind it might help. I suspect your glitching is getting picked up inductively, and having the adjacent metal shield would allow eddy currents to flow that would cancel the glitches.
I wasn't able to find the TIAs earlier, but it turns out that was because I was fiddling with the CSSK design which was uses a 5267. I don't understand why it let me place an Op-Amp in that space if the 5267 doesn't have Op-Amps. Anyway, moving over to the XTAnt design, I see the TIA in the library now. Unfortunately it has a maximum feedback cap of 4.6pF which isn't going to be enough if the key cap we're trying to sense is 12pF.DMA wrote: 06 Apr 2019, 20:25 5888 has 4 OpAmps, 4 comparators and 4 programmable blocks that can be told to be TIAs. I simply haven't seen a single reason to use them.
To me, a comparator is simpler than a multi-bit ADC, and my interests are in leaning things in that direction. What I'm trying to explore is why IBM could get away without a multi-bit ADC, without per-key thresholds, with slow 1970's microcontrollers, and still be able to build a robust capacitance sensing controller. If those methods are still accessible without excessive cost, why not use them?
Well, the same could be said of playing with designs based on flippers that are only available either new from a finite supply at $1 each or from cannibalizing old keyboards whose prices have doubled or tripled in the last few years.DMA wrote: 06 Apr 2019, 20:25There's this thing. It's called "manufacturability". You're not helping that by adding parts.Luns wrote: 02 Apr 2019, 06:31Both the diodes and resistors, I have plenty of kicking around, and literally cost a penny a piece. I'm willing to spend 2 cents if it yields a better design.
I subsequently found dfj's schematic, and was disappointed to see the opamps there weren't configured as TIAs, they were simple voltage followers. Sadly that puts it in the same camp as your and xwhatsit's designs in trying to sense voltage. What I see as the flaw with the DPH design is that there's nothing to explicitly define the DC point of the op-amp inputs. The inputs source a bias current of up to 100nA, but there's nothing there to sink that current, so the input voltages would float up and out of the op-amp's proper operating point.DMA wrote: 06 Apr 2019, 20:25OH WAI. TIA has zero input impedance. That's what killed DPH (well, actually it was the desire to maintain baseline voltage between zero and +5V - but the same thing conceptually.). Inability to store charge. You're forced to measure at a specific moment in time - very, very short moment. This just doesn't work.Luns wrote: 02 Apr 2019, 06:31The catch with doing this is that you'd need to strobe the drive line once per key as IBM did. Either that, or have a separate op-amp for each sense line as was done with the DPH design.
The "shove it back in" is the application of linear superposition, and is a way to get the attenuation of a simple capacitor divider without having to mess with equations. If you're familiar with Miller capacitance, you'd recognize where I went with things from there.DMA wrote: 06 Apr 2019, 20:25 And the part from "shove it back in" beyond is missing some fundamental understanding of how capacitors work.
TIA is zero input impedance with an infinite amplifier gain. That's exactly the point of using them - parasitic capacitances have no effect when they're shunted by zero impedance. An infinite cap is zero impedance. With finite gain, it's a nonzero, though small impedance; a finite but still large cap. The large cap is not a physically large cap, it's the feedback capacitor made to look much larger than it really is by the amplifier - this is what I meant by artifical: the cap is made to look larger than it really is.DMA wrote: 06 Apr 2019, 20:25 Adding TIA is not "adding a cap artificially" - TIA has zero input impedance, it will drain all the charge in nanoseconds and you'll be reading zeroes.
Adding a large cap sucks in any scenario - voltage is inverse square of charge state, 50% charged cap will produce 1/4 voltage of 100% charged one.
What you're measuring isn't the capacitance directly, you're measuring the attenuation of a capacitor divider with the key capacitor against an arbitrary capacitance including all the other caps on the same sense lines, and an uncontrolled amount of parasitic cap. What I'm switching to is measuring the ratio of the key cap to a feedback cap that has a value that we choose for ourselves.DMA wrote: 06 Apr 2019, 20:25 Also you're switching from measuring the capacitance directly to measuring a transfer function of the key capacitor.
None of what I'm suggesting is novel or untested: it's literally a textbook building block for switched capacitor circuitry. Take a look at the second figure of http://www.seas.ucla.edu/brweb/teaching/AIC_Ch12.pdf .DMA wrote: 06 Apr 2019, 20:25 Test the stuff, too. Make a simple matrix in that clowny simulator above, try your sensing. If it doesn't work in ideal world (and it won't, p<0.01!) - how would it work in real one?
It's simpler*. Problem is it doesn't really work. You need to know thresholds - or use ADC to get them at runtime, in which case not only you dragged ADC in, you also dragged in a DAC to set comparator thresholds. This may make sense if you have Unbelievably Crappy(sm) ADC, but a good DAC and comparator.Luns wrote: 07 Apr 2019, 05:16 To me, a comparator is simpler than a multi-bit ADC, and my interests are in leaning things in that direction.
"Excessive costs" things changed. IBM could go thru 10-15 PCB designs to achieve the flat field, but I guess ADCs were very expensive.Luns wrote: 07 Apr 2019, 05:16What I'm trying to explore is why IBM could get away without a multi-bit ADC, without per-key thresholds, with slow 1970's microcontrollers, and still be able to build a robust capacitance sensing controller. If those methods are still accessible without excessive cost, why not use them?
CS is known to work on topre (at my table), foam and foil (Sangdrax), it will likely will on Varmilo EC and other capacitive stuff. Turns out it also works for conductive switches as well, though I don't have any anti-ghosting.Luns wrote: 07 Apr 2019, 05:16Well, the same could be said of playing with designs based on flippers that are only available either new from a finite supply at $1 each or from cannibalizing old keyboards whose prices have doubled or tripled in the last few years.
And what does make you think that a device with zero input impedance connected to the cap won't bleed the charge immediately?Luns wrote: 02 Apr 2019, 06:31 Xwhatsit has a deliberate resistor for setting the DC point, but then struggles with that resistor also bleeding off the charge we're trying to detect. Your design correctly gets the DC point by discharging everything regularly.
Exaggerated - Vcc while there's charge and then zero. And since you don't have a sample-and-hold, your feedback capacitor will be drained by the same op-amp output that charged it.I felt a great disturbance in the Force, as if millions of voices suddenly cried out in terror and were suddenly silenced.
Yes. I'm not. And this is, like, written in the first post of this thread. Don't care about capacitances, just voltages on the pins. And guess what - I have some magvalve keyboards on the table, I'm going to try exactly the same approach on those, and would not be surprised if it works (will probably need external caps on sense lines). Just need some time.Luns wrote: 02 Apr 2019, 06:31 What you're measuring isn't the capacitance directly, you're measuring the attenuation of a capacitor divider with the key capacitor against an arbitrary capacitance including all the other caps on the same sense lines, and an uncontrolled amount of parasitic cap.
And you need all this tight control over environment because?.. This is not an LCR meter forumLuns wrote: 02 Apr 2019, 06:31What I'm switching to is measuring the ratio of the key cap to a feedback cap that has a value that we choose for ourselves.
But those are _switched_ capacitor circuits. And you didn't mention any switches so far.Luns wrote: 02 Apr 2019, 06:31None of what I'm suggesting is novel or untested: it's literally a textbook building block for switched capacitor circuitry. Take a look at the second figure of http://www.seas.ucla.edu/brweb/teaching/AIC_Ch12.pdf .
Forgive me for being defensive too. You're not the first to tell me (this will not work) or (I'm doing it wrong) or (IBM made it differently) or (it's too expensive, ATMEL is cheaper) or (not compatible with QMK so I won't get any mass adoption). I'm generally fine with those (except atmel one - fuck Harvard architecture and PROGMEM in particular.) - but I can't resist a good argument, especially with people who are wrongLuns wrote: 02 Apr 2019, 06:31BTW, I do want to say, forgive me if I come across as confrontational - that's not my intent at all, but I can see how things might be perceived that way.
It is not strictly necessary to use Cypress hardware. You just need the ability to put GPIOs to High-Z and a good ADC.Luns wrote: 02 Apr 2019, 06:31I didn't know the Cypress PSoCs even existed until learning of them here
DMA wrote: 16 Jul 2019, 18:45 @PancakeMSTR what part of picture is unclear?
@JP! - yes, ExpHdr pins are for that. ExpHdr_0 and ExpHdr_2 will be solenoid driver active pins if you select "solenoid" in hardware setup.
DMA wrote: 16 Jul 2019, 18:45 @PancakeMSTR what part of picture is unclear?
@JP! - yes, ExpHdr pins are for that. ExpHdr_0 and ExpHdr_2 will be solenoid driver active pins if you select "solenoid" in hardware setup.