Sign in to follow this  
Followers 0

Help needed for implementing 3rd shift register for keyboard scanning

3 posts in this topic

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

Thanks people!


Share this post

Link to post
Share on other sites

No one? Any help would be very appreciated! 

Share this post

Link to post
Share on other sites

Posted (edited)

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;


    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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0