Help needed for implementing 3rd shift register for keyboard scanning

Hey people,

here is the problem:
FATAR has changed the diode-matrix of their keybeds recently. So the DIO-matrix is not usable for those keybeds anymore. I want to get it running and of course I’m happy to design a new DIO-matrix and of course post it here so everybody can use it.

So… I’m not 100% sure about the diode-matrix yet. In the old diode-matrix both keyboard sides (left and right) had separate rows. So the left side had 8 rows, the right side had 8 rows:

Look at this pictures. With “rows” I mean T0-T7. 

In the new diode-matrix it looks like both sides use the same rows. Because if I plug in a new keybed (via an adapter) into a DIO-matrix (which I did many times before with old keybeds though old diode-matrix) it outputs correct values from a-1 (lowest key) till middle-C. With the next key C#3 the left side starts. But C#3 outputs a-1. Further tests confirmed my assumption, that both sides share the same set of T0-T7. 

So that means: I need a shiftregister more than is available on the DIO-matrix. At the moment I have T0-T7 connected to the 8 inputs of the HC165, MK&BK are connected to the 16 outputs of the two HC595s. So in total I can connect 64 keys to the DIO-matrix. I now want to add another 595 to connect the last keys. Of course connecting the 595 itself is easy and done quickly. But I need to adapt the code and what I’ve tried so far was not working. I need to add a dout_sr3 to the code…

Any help?? Maybe  could point me in the right direction!

Thanks people!

Best,
Chris

No one? Any help would be very appreciated! 

Hello Chris,

I am probably the fifth wheel, but if no one else answers… Here are my 2 pences.

I suspect you have to modify trunk\modules\keyboard\keyboard.h to add a

u8 dout\_sr3;

near dout_sr2,

then find all occurences of dout_sr2 in trunk\modules\keyboard\keyboard.c, and add management for dout_sr3 in a similar way. Be careful, you should also modify 

 u16 selection\_mask = ~(1 \<\< (u16)kc-\>selected\_row); if( kc-\>din\_inverted ) selection\_mask ^= 0xffff;

in

 u32 selection\_mask = ~((u32)1 \<\< (u16)kc-\>selected\_row); if( kc-\>din\_inverted ) selection\_mask ^= 0xffffffff;

finally modify trunk\apps\controllers\midibox_ng_v1\src\mbng_file_c.c for manageing command input (find all occurences of dout_sr2 and add management for dout_sr3), and trunk\apps\controllers\midibox_ng_v1\src\mbng_kb.c for initialization.

Obviously, I did not try, hence I cannot tell if missing something…

Good luck!