There is a nice chip E510 for $20 that does a job I'd like to implement on core32+dinx:
http://www.cedos.com/e510_midi_chip.htm (see datasheet)
Why not using this chip? Because anyway core32 module is used and, I
think, it won't take all of it's resources to scan ~128 keys.
Then you may ask WHY CHANGEOVER type of contacts?
1. This type of contacts if the most convenient for implementing
mechanics on pianos, accordions, organs. Mechanical calibration is
simple. There is one pin for each key switching from one common bar
bus to another (so called NO and NC buses). Time between switches
is mapped to note velocity.
2. You have to connect as many wires as many keys you have + 2 (NO
bar and NC bar).
That's an advantage comparing to industrial
contact matrixes that has twice as many contacts.
Switch over contacts from my accordion (yet 1 bar missing, sorry) and scan matrix from Roland synth:
3. Anyway you have to use diodes for the matrix, so why don't use
multiplexors (or shift registers like on DINX) instead ? :) The prices
for those industrial keymatrix parts are $155 for PCB + $5 * 4 for
rubber contacts = $175 (prices found here
http://www.midi-store.com/Fatar-keyboard-parts-p-1-c-360.html )
Maybe PCB can be etched by yourself, so one could buy only rubber
contacts, but they don't fit into every music instrument that one
would like to midify.
Changeover type of contacts are universal :)
So I have one idea how to scan changeover contacts via DINX module.
Ground of the contacts in DINX module will be no longer Ground. It
will be connected to NO input bar or NC input bar during key movement.
So in order to distinguish between those 2 bars I have to connect both
of them to digital outputs of stm32 chip.
Scanning process will be made in two stages:
1. Set NO bar to low, NC bar to high, scan all the contacts.
2. Set NO bar to high, NC bar to low, scan all the contacts.
This way I'll get to know that contacts are pressed to NO bar, what
contacts are pressed to NC bar and what contacts are in intermediate
state (not pressed to any bar).
Am I thinking in a right direction? Can I replace GND in contacts in
DINX module with stm32's outputs?