Jump to content

Help needed for implementing 3rd shift register for keyboard scanning


FantomXR

Recommended Posts

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:
Matrix_88.gif

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 @TK. could point me in the right direction!

Thanks people!

Best,
Chris

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

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!

Edited by Cristiano
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...