aurel33

Debugging my core STM32f4 + diomatrix + fatar keybed

31 posts in this topic

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).

mios.thumb.jpg.df7323478ba547e8dc08b2cd9

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.

Thanks!

 

 

 

 

 

IMG_20151122_124625.jpg

IMG_20151122_124725.jpg

 

IMG_20151122_163729.jpg

IMG_20151122_114559.jpg

Edited by aurel33
added infos & pics

Share this post


Link to post
Share on other sites

Turn off the optimization to ensure that all pins are scanned while connecting Ox to Ix pins:

set kb 1 optimized off

Best Regards, Thorsten.

Share this post


Link to post
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.

Thanks!

Edited by aurel33

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

I installed mios128 and it's still the same, no sign of life from the inputs... i guess i'll have to double check my solders... :(

bugmios.jpg

Share this post


Link to post
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:
http://ucapps.de/mbhp_dio_matrix.html

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

Share this post


Link to post
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 ?

 cabletwist.thumb.jpg.b915e90d0005fb75449

 

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!

 

 

Share this post


Link to post
Share on other sites

No, the cables on the picture are not twisted. Again: Please check the link that I've posted above. There is a picture of how the cable has to be made.

Edited by FantomXR

Share this post


Link to post
Share on other sites

Well i don't understand, i used this picture from diomatrix page to make my cable :

mbhp_dio_matrix_6.jpg

The cable at the right on my picture is the same to me, i don't see the difference :(

Share this post


Link to post
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:

mbhp_dio_matrix_10.jpg

@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.

Share this post


Link to post
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 :(

IMG_20151123_221347.jpg

IMG_20151123_221501.jpg

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Edit:

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

Share this post


Link to post
Share on other sites

Fine that the module is working now! :)

To align the MIDI notes, please search in the documentation for "note_offset" and "din_key_offset":

http://www.ucapps.de/midibox_kb.html

Best Regards, Thorsten.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

i'm using a fatar tp40m from a nord keyboard.

 

ps: i've tried it on a sl880 board and it worked.

Edited by aurel33

Share this post


Link to post
Share on other sites

Nord does modifications on the keybeds respective let them produce in a special way from Fatar. That explains the problems you have. 

Share this post


Link to post
Share on other sites

Hmm i don't think so, as i said i connected it to a sl880 motherboard and it worked perfectly.

Share this post


Link to post
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 ?

 

Thanks!

 

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