Jump to content

Debugging my core STM32f4 + diomatrix + fatar keybed


Recommended Posts

Hello all,

I've build my core stm32F4(fantomxr pcb) + diomatrix + fatar adapter to connect my 88 keyboard.
I installed midibox kb and connected everything, but i can't output any midi, so i guess i did something wrong :)

I tried the virtual keyboard and i didn't receive any midi input in my daw, so i was wondering if my setup was correct, it seems midibox kb is loaded correctly(cf picture).


Here's the setup of my midibox kb:

[13020.190] kb 1 debug on
[13020.190] kb 1 midi_ports 0x0001
[13020.190] kb 1 midi_chn 1
[13020.190] kb 1 note_offset 21
[13020.190] kb 1 rows 12
[13020.191] kb 1 velocity on
[13020.191] kb 1 release_velocity off
[13020.191] kb 1 optimized on
[13020.191] kb 1 dout_sr1 1
[13020.191] kb 1 dout_sr2 2
[13020.192] kb 1 din_sr1 1
[13020.192] kb 1 din_sr2 2
[13020.192] kb 1 din_key_offset 40
[13020.192] kb 1 din_inverted off
[13020.193] kb 1 break_inverted off
[13020.193] kb 1 make_debounced off
[13020.193] kb 1 break_is_make off
[13020.193] kb 1 delay_fastest 50
[13020.194] kb 1 delay_fastest_black_keys 0
[13020.194] kb 1 delay_fastest_release 150
[13020.195] kb 1 delay_fastest_release_black_keys 0
[13020.195] kb 1 delay_slowest 1000
[13020.195] kb 1 delay_slowest_release 1000
[13020.196] kb 1 ain_pitchwheel off
[13020.196] kb 1 ctrl_pitchwheel 128 (PitchBend)
[13020.196] kb 1 ain_pitchwheel_inverted off
[13020.196] kb 1 ain_modwheel off
[13020.198] kb 1 ctrl_modwheel 1 (CC)
[13020.198] kb 1 ain_modwheel_inverted off
[13020.198] kb 1 ain_expression off
[13020.198] kb 1 ctrl_expression 11 (CC)
[13020.199] kb 1 ain_expression_inverted off
[13020.199] kb 1 ain_sustain off
[13020.199] kb 1 ctrl_sustain 64 (CC)
[13020.205] kb 1 ain_sustain_inverted off
[13020.205] kb 1 ain_sustain_switch off
[13020.205] kb 1 ain_bandwidth_ms 0
[13020.205] AIN Calibration Mode disabled.

Then i wanted to check if my diomatrix was ok so i connected I1 to O1 on J3 to check for midi input, but i did not receive anything(no data in mios input).

Is there a way to troubleshoot easily diomatrix ? or some tension to check on the core stm32F4 , i've checked my soldering and connection with a multimeter and everything seems ok.












Edited by aurel33
added infos & pics
Link to comment
Share on other sites

Thanks for the answer!

I've turned off optimization off, but still not getting anything in my midi input window, is there something to setup with the router command?
I managed to make the virtual keyboard work with " router 1 USB1 all USB1 all"

Also, it seems there's a "twisted cable" needed on the core> dio connection, i don't really get it, does it means pin 1 = pin 9?
it's weird because on the schematics it's really 1:1, and you can see on my installation, pin 1 is going to pin1.


Edited by aurel33
Link to comment
Share on other sites

No special setup is required on the MIDI router.

I'm no keyboard expert and therefore can't give you reliable information how to connect this particular hardware.

But from the firmware side I think the most simple tests are the following:

- turn off scan optimization (as mentioned above)

- input test:
connect a short cable from Vs (ground) to I0 -> up to 8 Note On messages should be sent.
Note Off messages will be sent when the cable is removed.

Repeat this test for the remaining inputs (J3:I0..I7 and J4:I0..I7)

With this test, no proper break/make scheme is applied, and in worst case inputs stay at break and won't sent a note anymore - so, reset the core before repeating the next tests.

- output test:
instead of connecting I0 to ground, just connect it to O7/O6 via diodes (O7=make, O6=break; break has to be activated first; make sends the note).
Only a single note on/off message should be sent.
This can be repeated for the remaining output pairs.

Best Regards, Thorsten.

Edited by TK.
Link to comment
Share on other sites

Thanks Tk, that's a perfect test.

I did it with the input(connected J2 Vss to J3.I0), and i didn't get anything, i guess i must have screwed somewhere on my diomatrix...

None of the input works :( It seems the tension is ok on the board, i'm getting 4.1V on both HC595 and HC165


Edited by aurel33
Link to comment
Share on other sites

It makes sense to upload the MIDIO128 application to doublecheck, if the inputs are really not working, or if it's related to a configuration problem.

By default and without any special configuration, MIDIO128 will send a dedicated note event whenever an input pin is connected to ground.

Best Regards, Thorsten.

Link to comment
Share on other sites

Dear aurel33,

I already wrote you a message, that you need to twist the cable, that goes from the core to the DIO. Did you test it with a twisted cable?

Look here:

and also I wrote you that you need to use straight cables, that go from the adaptor to the DIO. It will not work with a twisted cable. 

Edited by FantomXR
Link to comment
Share on other sites

Thanks fantomxr !

Yes i’ve checked your answer but the problem is i can’t figure out what is a twisted cable and how to do it, here’s a picture of two cables i’ve made, are they different ?



Is the one on the right twisted ? I’ve tested both and it’s exactly the same behaviour, not working L

I'm a bit lost, i thought there was only one kind of wiring used(red cable on pin1), if i "twist" the cable, it would mean red cable would be on pin9 on one side and pin1 on the other ?


Thanks for your support!



Link to comment
Share on other sites

Meanwhile I also think that something is wrong with the cables, resp. the sockets (but this is hard to determine based on the snapshots).

The notch of the J8/9 socket on the core module should show to the outer border, the same for the DIO module.

Here a picture:


@Christian: can you confirm that the socket orientation of your board is the same like for the original MBHP_CORE_STM32F4 module?

Best Regards, Thorsten.

Link to comment
Share on other sites

Yes, the socket orientation is reversed on chris pcb, i guess he did it to have a straight cable.

Anyway i did a twisted cable and connected it, tried Vss to I0, still no input in mios, i'll check all my solders tomorrow, i also may have damaged some components if i connected the cable the wrong way :(



Link to comment
Share on other sites

When I created the PCBs I didn't put any attention on the notches of the sockets. So the orientation is random.

And again: You need to twist the cable. Why do you use still a straight cable (last picture you posted)?!? TK gave also exact informations...

Anyway... it seems that you need a more in depth-explanation. Here it is and forget about the cable relief for now:

1.) Put the core and the DIO on a table
2.) Place the DIO to the right of the Core so that J8/9 and the input of the DIO face each other
3.) Take a 10pin ribbon cable, which is about 10cm long
4.) Put an IDC connector on the left side of the cable with the notch facing the core (red cable is on the top)
5.) Turn the cable by 180°
6.) Put an IDC connector on the right side of the cable with the notch facing the left-border of the DIO-PCB (red cable is on the bottom).
7.) Connect the core with the DIO and it should work.
8.) Use STRAIGHT cables for connecting the adaptor to the DIO and NOT twisted cables (like you did in the pictures above).

Edited by FantomXR
Link to comment
Share on other sites

Thanks for your patience and support guys!
I don't know why i wanted pin1 to be always pin1, i had all the cable wrong...

So one twisted cable from core to dio, and two straight cable from dio to adapter, well still not working but at least i guess i have the cables right now.

I think i'll replace the ICs, i may have killed one with my wrong wiring...

Socable.thumb.jpg.20c28123f00368775a86eb08 did another

Edited by aurel33
Link to comment
Share on other sites

Good news diomatrix input is now working!
The keyboard is working too ! By the way, my cables for the dio to adapter were working(they were 1:1)

However, still have some problem : my keyboard is only active on 61 keys and outputs one step higher,  but it may come from the midikb setup.


Ok i did some more tests with the exact same midiboxkb setup, i must have screwed again on the cables or adapter(mk-10 03 + bk10-04 soldered)

All along the keyboard, i get a sequence of right notes for 6 keys and then two keys are screwed and so on for 61 keys.

For example, on my keyboard :
Lowest F outputs G3 midi
Lowest G outputs A1


Edited by aurel33
Link to comment
Share on other sites

Thanks TK! making progress!

Tk > i wanted to test the outputs with your method, i've used a diode 1N4148 between I0 and O6, then I0 to O7 and didn't receive any signal(anode on I0 and cathod on Ox).


As for the midibox kb setup, I've activated the keyboard debug on and it's really helpfu!

What is really intriguing is the fact that the midi output is alternating between six low notes(in green) and two high notes(in red), and that i don't get any input from the lowest octave on the keyboard, and highest octave part of the keyboard.
Here's one octave run starting from C1(the second lowest C on the keyboard)

C1:  [10053.956] KB1: DOUT#1.D6 / DIN#1.D5: depressed  -->  key= 5, break contact, note=D-0 (26)
C#1 [10066.147] KB1: DOUT#1.D4 / DIN#2.D6: depressed  -->  key=54, break contact, note=D#4 (75)
D1   [10078.940] KB1: DOUT#1.D4 / DIN#2.D7: depressed  -->  key=55, break contact, note=E-4 (76)
D#1 [10099.686] KB1: DOUT#1.D4 / DIN#1.D0: depressed  -->  key= 8, break contact, note=F-0 (29)
E1   [10131.708] KB1: DOUT#1.D4 / DIN#1.D1: depressed  -->  key= 9, break contact, note=F#0 (30)
F1   [10147.171] KB1: DOUT#1.D4 / DIN#1.D2: depressed  -->  key=10, break contact, note=G-0 (31)
F#1 [10632.243] KB1: DOUT#1.D4 / DIN#1.D3: depressed  -->  key=11, break contact, note=G#0 (32)
G1  [10665.443] KB1: DOUT#1.D4 / DIN#1.D4: depressed  -->  key=12, break contact, note=A-0 (33)
G#1 [10704.495] KB1: DOUT#1.D4 / DIN#1.D5: depressed  -->  key=13, break contact, note=A#0 (34)

A1   [10725.780] KB1: DOUT#1.D2 / DIN#2.D6: depressed  -->  key=62, break contact, note=B-4 (83)
A#1  [10906.585] KB1: DOUT#1.D2 / DIN#2.D7: depressed  -->  key=63, break contact, note=C-5 (84)

B1    [10765.479] KB1: DOUT#1.D2 / DIN#1.D0: depressed  -->  key=16, break contact, note=C#1 (37)
C2  [10777.883] KB1: DOUT#1.D2 / DIN#1.D1: depressed  -->  key=17, break contact, note=D-1 (38)
C#2 [10949.601] KB1: DOUT#1.D2 / DIN#1.D2: depressed  -->  key=18, break contact, note=D#1 (39)
D2   [10964.364] KB1: DOUT#1.D2 / DIN#1.D3: depressed  -->  key=19, break contact, note=E-1 (40)
D#2 [10982.418] KB1: DOUT#1.D2 / DIN#1.D4: depressed  -->  key=20, break contact, note=F-1 (41)
E2   [11000.697] KB1: DOUT#1.D2 / DIN#1.D5: depressed  -->  key=21, break contact, note=F#1 (42)

F2  [11017.863] KB1: DOUT#1.D0 / DIN#2.D6: depressed  -->  key=70, break contact, note=G-5 (91)
f#2 [11095.561] KB1: DOUT#1.D0 / DIN#2.D7: depressed  -->  key=71, break contact, note=G#5 (92)






Edited by aurel33
Link to comment
Share on other sites

So, i've tested my setup with a fatar tp20 and fatar tp40, the result is exactly the same, so the keyboard is not involved.

Tk, i have one question, I want to be sure my outputs are working and i wasn't able to use your output testing method, could you confirm it's the right way to test it:
I0 ----- (anode)DIODE ------ O6/O7 ?




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.

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.


  • Create New...