Howdy.
So, I have that old Allen T-12a, which I am MIDIfying into a VPO.
I don't have a schematic, but it looks like the key switches ground the input contact when the key is pressed (that's how I'll wire it, anyway, even if it isn't really doing that currently). It's a bussed keyboard, rather than a matrix.
I plan to do my MIDI encoding with a Teensy 2.0 microcontroller.
In web-searching and head-scratching about the best way to decode a bussed keyboard, I am finding circuits that use shift registers. That seems a little too complicated to me.
So yeah, I apologize if I am being really dumb, but....
I am kinda wondering why I can't just use 8 octal tri-state buffers (for a single 61 key manual), whose inputs are pulled low when the keys are pressed. The outputs of the tri-state buffers could then be tied together and fed into 8 pins of the microcontroller. Then 8 output pins on the microcontroller could be used to select which of the tri-state buffers would be turned "on" at a time. It would kinda look like a matrix keyboard to the software (and only use 16 pins instead of 61).
Or heck, might just be able to use transistors instead of tri-state buffers, but I am extra-dumb about electronics that aren't strictly digital.
So rather than clocking a shift register, you'd just set "bank enable 0" low, read the 8 bits of input for the first 8 keys, set "bank enable 0" high again and "bank enable 1" low, read the next 8 bits for the next 8 keys, and so on and so forth until all the keys were read. I would assume that a 16MHz AVR microcontroller would be able to do this fast enough that timing would be a non-issue, even if one doubled the number of octal tri-state buffers and implemented velocity sensitivity with a second row of switches (I think I can modify the Allen manuals to do this by sliding a piece of tubing over half of each of the wooden bars in there, to make the whisker contacts stand out at different distances, but that's a discussion for another time lol). I would think that a scan rate above 100/sec would be plenty sufficient.
However, if it were actually that easy, you'd think that's what everyone would be doing, instead of using shift registers. I would assume nothing bad would happen if more than one of the octal buffers was active (outputs trying to drive each other) until the microcontroller initialized and turned them all off? (Edit: After hmm-hawing a little, I am pretty sure that all the IO pins on the AVR board are tri-stated when it boots up, so as long as the software doesn't do something stupid it all ought to be alright......... I suppose if one wanted to be ultra-paranoid, one could use an address decoder on the enable lines to make sure that only one could be pulled low at a time, regardless of the state of the microcontroller.)
What do y'all think? I haven't done anything like this since I was in college, which was uh... Several years ago. I'm afraid I may no longer know what I am doing (assuming I ever did to begin with). :P
Would it be a little more clear if I scribbled a schematic and posted it? Here:
I omitted the pull-up resistors, but you get the gist, right?
So, I have that old Allen T-12a, which I am MIDIfying into a VPO.
I don't have a schematic, but it looks like the key switches ground the input contact when the key is pressed (that's how I'll wire it, anyway, even if it isn't really doing that currently). It's a bussed keyboard, rather than a matrix.
I plan to do my MIDI encoding with a Teensy 2.0 microcontroller.
In web-searching and head-scratching about the best way to decode a bussed keyboard, I am finding circuits that use shift registers. That seems a little too complicated to me.
So yeah, I apologize if I am being really dumb, but....
I am kinda wondering why I can't just use 8 octal tri-state buffers (for a single 61 key manual), whose inputs are pulled low when the keys are pressed. The outputs of the tri-state buffers could then be tied together and fed into 8 pins of the microcontroller. Then 8 output pins on the microcontroller could be used to select which of the tri-state buffers would be turned "on" at a time. It would kinda look like a matrix keyboard to the software (and only use 16 pins instead of 61).
Or heck, might just be able to use transistors instead of tri-state buffers, but I am extra-dumb about electronics that aren't strictly digital.
So rather than clocking a shift register, you'd just set "bank enable 0" low, read the 8 bits of input for the first 8 keys, set "bank enable 0" high again and "bank enable 1" low, read the next 8 bits for the next 8 keys, and so on and so forth until all the keys were read. I would assume that a 16MHz AVR microcontroller would be able to do this fast enough that timing would be a non-issue, even if one doubled the number of octal tri-state buffers and implemented velocity sensitivity with a second row of switches (I think I can modify the Allen manuals to do this by sliding a piece of tubing over half of each of the wooden bars in there, to make the whisker contacts stand out at different distances, but that's a discussion for another time lol). I would think that a scan rate above 100/sec would be plenty sufficient.
However, if it were actually that easy, you'd think that's what everyone would be doing, instead of using shift registers. I would assume nothing bad would happen if more than one of the octal buffers was active (outputs trying to drive each other) until the microcontroller initialized and turned them all off? (Edit: After hmm-hawing a little, I am pretty sure that all the IO pins on the AVR board are tri-stated when it boots up, so as long as the software doesn't do something stupid it all ought to be alright......... I suppose if one wanted to be ultra-paranoid, one could use an address decoder on the enable lines to make sure that only one could be pulled low at a time, regardless of the state of the microcontroller.)
What do y'all think? I haven't done anything like this since I was in college, which was uh... Several years ago. I'm afraid I may no longer know what I am doing (assuming I ever did to begin with). :P
Would it be a little more clear if I scribbled a schematic and posted it? Here:
I omitted the pull-up resistors, but you get the gist, right?
Comment