Jump to content

MIOS Matrix


novski
 Share

Recommended Posts

Hi

Im Trying to get my Matrix working but have some problems with the commands.

 

Getting back to this in my Vacation im now testing the self-made board of this Schematic:

post-10711-0-10201800-1406380623_thumb.p

 

Im trying to program it in MIOS but i can't find out why the second and third button row doesn't react. And instead the First row shows all three Values by pressing the corresponding button of the first row.

The LEDs don't light up at all...

 

Based on the Testfiles i added some helpful code to display the pressed Value but in main its from repository:

 

RESET_HW

LCD "%C"
LCD "@(1:1:1)OLED1"
LCD "@(2:1:1)OLED2"
LCD "@(3:1:1)OLED3"
LCD "@(4:1:1)OLED4"
LCD "@(5:1:1)OLED5"
LCD "@(6:1:1)OLED6"
LCD "@(7:1:1)OLED7"
LCD "@(8:1:1)OLED8"

# In this demo we configure individual brightness levels for the LEDs from EVENT_BUTTON events

LCD "@(1:10:1)RGB Demo #2"

DIN_MATRIX  n=1  rows=8  inverted=1  sr_dout_sel1=1  sr_din1=1                                     button_emu_id_offset=1001
DOUT_MATRIX n=1  rows=8  inverted=0  sr_dout_sel1=1  sr_dout_r1=2  sr_dout_g1=3 sr_dout_b1=5       led_emu_id_offset=1001

# These button functions forward their value also to LEDs
# it's possible to set the rgb levels in the button event, it will be forwarded as well!

EVENT_BUTTON  id=1001  fwd_id=LED:1001  type=NoteOn key=36 chn=1  rgb=15:0:0 lcd_pos=1:1:2 label="^std_btn"
EVENT_BUTTON  id=1002  fwd_id=LED:1002  type=NoteOn key=37 chn=1  rgb=15:0:0 lcd_pos=2:1:2 label="^std_btn"
EVENT_BUTTON  id=1003  fwd_id=LED:1003  type=NoteOn key=38 chn=1  rgb=15:0:0 lcd_pos=3:1:2 label="^std_btn"
EVENT_BUTTON  id=1004  fwd_id=LED:1004  type=NoteOn key=39 chn=1  rgb=15:0:0 lcd_pos=4:1:2 label="^std_btn"
EVENT_BUTTON  id=1005  fwd_id=LED:1005  type=NoteOn key=40 chn=1  rgb=15:0:0 lcd_pos=5:1:2 label="^std_btn"
EVENT_BUTTON  id=1006  fwd_id=LED:1006  type=NoteOn key=41 chn=1  rgb=15:0:0 lcd_pos=6:1:2 label="^std_btn"
EVENT_BUTTON  id=1007  fwd_id=LED:1007  type=NoteOn key=42 chn=1  rgb=15:0:0 lcd_pos=7:1:2 label="^std_btn"
EVENT_BUTTON  id=1008  fwd_id=LED:1008  type=NoteOn key=43 chn=1  rgb=15:0:0 lcd_pos=8:1:2 label="^std_btn"

EVENT_BUTTON  id=1009  fwd_id=LED:1009  type=NoteOn key=52 chn=1  rgb=15:15:0 lcd_pos=1:1:3 label="^std_btn"
EVENT_BUTTON  id=1010  fwd_id=LED:1010  type=NoteOn key=53 chn=1  rgb=15:15:0 lcd_pos=2:1:3 label="^std_btn"
EVENT_BUTTON  id=1011  fwd_id=LED:1011  type=NoteOn key=54 chn=1  rgb=15:15:0 lcd_pos=3:1:3 label="^std_btn"
EVENT_BUTTON  id=1012  fwd_id=LED:1012  type=NoteOn key=55 chn=1  rgb=15:15:0 lcd_pos=4:1:3 label="^std_btn"
EVENT_BUTTON  id=1013  fwd_id=LED:1013  type=NoteOn key=56 chn=1  rgb=15:15:0 lcd_pos=5:1:3 label="^std_btn"
EVENT_BUTTON  id=1014  fwd_id=LED:1014  type=NoteOn key=57 chn=1  rgb=15:15:0 lcd_pos=6:1:3 label="^std_btn"
EVENT_BUTTON  id=1015  fwd_id=LED:1015  type=NoteOn key=58 chn=1  rgb=15:15:0 lcd_pos=7:1:3 label="^std_btn"
EVENT_BUTTON  id=1016  fwd_id=LED:1016  type=NoteOn key=59 chn=1  rgb=15:15:0 lcd_pos=8:1:3 label="^std_btn"

EVENT_BUTTON  id=1017  fwd_id=LED:1017  type=NoteOn key=68 chn=1  rgb=15:4:0 lcd_pos=1:1:4 label="^std_btn"
EVENT_BUTTON  id=1018  fwd_id=LED:1018  type=NoteOn key=69 chn=1  rgb=15:4:0 lcd_pos=2:1:4 label="^std_btn"
EVENT_BUTTON  id=1019  fwd_id=LED:1019  type=NoteOn key=70 chn=1  rgb=15:4:0 lcd_pos=3:1:4 label="^std_btn"
EVENT_BUTTON  id=1020  fwd_id=LED:1020  type=NoteOn key=71 chn=1  rgb=15:4:0 lcd_pos=4:1:4 label="^std_btn"
EVENT_BUTTON  id=1021  fwd_id=LED:1021  type=NoteOn key=72 chn=1  rgb=15:4:0 lcd_pos=5:1:4 label="^std_btn"
EVENT_BUTTON  id=1022  fwd_id=LED:1022  type=NoteOn key=73 chn=1  rgb=15:4:0 lcd_pos=6:1:4 label="^std_btn"
EVENT_BUTTON  id=1023  fwd_id=LED:1023  type=NoteOn key=74 chn=1  rgb=15:4:0 lcd_pos=7:1:4 label="^std_btn"
EVENT_BUTTON  id=1024  fwd_id=LED:1024  type=NoteOn key=75 chn=1  rgb=15:4:0 lcd_pos=8:1:4 label="^std_btn" 

post-10711-0-88285900-1406381043_thumb.j post-10711-0-09800700-1406381085_thumb.j

 

While the Midimoitor shows this while pressing and depressing button 1 row 0:

 

[13821.564] 90 24 7f   Chn# 1  Note On  C-1  Vel:127

[13821.567] 90 44 7f   Chn# 1  Note On  G#3  Vel:127
[13821.578] 90 34 7f   Chn# 1  Note On  E-2  Vel:127
[13821.760] 90 24 00   Chn# 1  Note Off C-1 (optimized)
[13821.763] 90 44 00   Chn# 1  Note Off G#3 (optimized)
[13821.774] 90 34 00   Chn# 1  Note Off E-2 (optimized)

 

Can somebody help me with that?

Novski

Link to comment
Share on other sites

I had a quick look into the schematic.

 

It looks like you are using 3 rows for the LEDs, and 3 for the buttons, right?

In this case I would use row=4 for both matrices (DIN_MATRIX and DOUT_MATRIX), so that the row selection signals will be duplicated (visible at D0..D3 and D4..D7)

 

This doesn't explain why the buttons trigger the events of 3 rows at once, but it might be a good starting point for debugging.

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi TK.

Yes thats correct i use 3 Rows for LEDs and 3 Rows for Buttons from the same Shift Register.

I just tryed to change the rows=8 to rows=4 but that didn't change any of the behaviors. I also noticed that the DIN_Matrix line was inverting=1 what i now changed to inverting=0. 

Is the schematic done right?

Thank you 

best regards, novski

Link to comment
Share on other sites

The schematic looks correct.

Maybe an electrical problem?

 

Are you able to remove the button matrix from the remaining circuit?

Then just connect the row selection signals (IC1 Pin 7, 6, 5) with the column inputs at IC2 with a cable, one after another.

 

Each connection should trigger an individual MIDI event.

 

If this doesn't work, connect an alternative DIN and DOUT module (or a MBHP_DIO_MATRIX if available) and check the same.

This ensures that the matrix configuration is correct, and that you know where to continue debugging...

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi TK.

Thanks for your reply

I can't swap anything because of the rubber buttons i made all in surface mount on the Bottomside of the PCB...

post-10711-0-00948600-1406476091_thumb.j

To me it looks like the column are short but if i measure B1 to B9 its a open line in both sides. also if i push the button B1 while i measure, B1 and B9 are not short connected... 

I changed both SR 1&2 but it stays the same. If i press B1 the Value of B1,9,17 goes to Value 127 and all three LEDs lit up. as they should but if they get V127 but i don't know from where they get the V127 because im pressing just B1.

post-10711-0-08628700-1406476981_thumb.jpost-10711-0-53264700-1406477000_thumb.jpost-10711-0-71615000-1406477019_thumb.j

 

no clue.

i need a beer.  :mad:

Edited by novski
Link to comment
Share on other sites

Why does this work

RESET_HW

LCD "%C"
LCD "@(1:1:1)OLED1"
LCD "@(2:1:1)OLED2"
LCD "@(3:1:1)OLED3"
LCD "@(4:1:1)OLED4"
LCD "@(5:1:1)OLED5"
LCD "@(6:1:1)OLED6"
LCD "@(7:1:1)OLED7"
LCD "@(8:1:1)OLED8"

# In this demo we configure individual brightness levels for the LEDs from EVENT_BUTTON events

LCD "@(1:10:1)RGB Demo #2"

DIN_MATRIX  n=1  rows=4  sr_dout_sel1=1  sr_din1=1                     button_emu_id_offset=1001
DOUT_MATRIX n=1  rows=4  sr_dout_r1=2    sr_dout_g1=3 sr_dout_b1=4     led_emu_id_offset=1025

# These button functions forward their value also to LEDs
# it's possible to set the rgb levels in the button event, it will be forwarded as well!

EVENT_BUTTON  id=1001  fwd_id=LED:1025  type=NoteOn key=36 chn=1  rgb=15:0:0 lcd_pos=1:1:2 label="^std_btn"
EVENT_BUTTON  id=1002  fwd_id=LED:1026  type=NoteOn key=37 chn=1  rgb=15:0:0 lcd_pos=2:1:2 label="^std_btn"
EVENT_BUTTON  id=1003  fwd_id=LED:1027  type=NoteOn key=38 chn=1  rgb=15:0:0 lcd_pos=3:1:2 label="^std_btn"
EVENT_BUTTON  id=1004  fwd_id=LED:1028  type=NoteOn key=39 chn=1  rgb=15:0:0 lcd_pos=4:1:2 label="^std_btn"
EVENT_BUTTON  id=1005  fwd_id=LED:1029  type=NoteOn key=40 chn=1  rgb=15:0:0 lcd_pos=5:1:2 label="^std_btn"
EVENT_BUTTON  id=1006  fwd_id=LED:1030  type=NoteOn key=41 chn=1  rgb=15:0:0 lcd_pos=6:1:2 label="^std_btn"
EVENT_BUTTON  id=1007  fwd_id=LED:1031  type=NoteOn key=42 chn=1  rgb=15:0:0 lcd_pos=7:1:2 label="^std_btn"
EVENT_BUTTON  id=1008  fwd_id=LED:1032  type=NoteOn key=43 chn=1  rgb=15:0:0 lcd_pos=8:1:2 label="^std_btn"

EVENT_BUTTON  id=1009  fwd_id=LED:1033  type=NoteOn key=52 chn=1  rgb=0:15:0 lcd_pos=1:1:3 label="^std_btn"
EVENT_BUTTON  id=1010  fwd_id=LED:1034  type=NoteOn key=53 chn=1  rgb=0:15:0 lcd_pos=2:1:3 label="^std_btn"
EVENT_BUTTON  id=1011  fwd_id=LED:1035  type=NoteOn key=54 chn=1  rgb=0:15:0 lcd_pos=3:1:3 label="^std_btn"
EVENT_BUTTON  id=1012  fwd_id=LED:1036  type=NoteOn key=55 chn=1  rgb=0:15:0 lcd_pos=4:1:3 label="^std_btn"
EVENT_BUTTON  id=1013  fwd_id=LED:1037  type=NoteOn key=56 chn=1  rgb=0:15:0 lcd_pos=5:1:3 label="^std_btn"
EVENT_BUTTON  id=1014  fwd_id=LED:1038  type=NoteOn key=57 chn=1  rgb=0:15:0 lcd_pos=6:1:3 label="^std_btn"
EVENT_BUTTON  id=1015  fwd_id=LED:1039  type=NoteOn key=58 chn=1  rgb=0:15:0 lcd_pos=7:1:3 label="^std_btn"
EVENT_BUTTON  id=1016  fwd_id=LED:1040  type=NoteOn key=59 chn=1  rgb=0:15:0 lcd_pos=8:1:3 label="^std_btn"

EVENT_BUTTON  id=1017  fwd_id=LED:1041  type=NoteOn key=68 chn=1  rgb=0:0:15 lcd_pos=1:1:4 label="^std_btn"
EVENT_BUTTON  id=1018  fwd_id=LED:1042  type=NoteOn key=69 chn=1  rgb=0:0:15 lcd_pos=2:1:4 label="^std_btn"
EVENT_BUTTON  id=1019  fwd_id=LED:1043  type=NoteOn key=70 chn=1  rgb=0:0:15 lcd_pos=3:1:4 label="^std_btn"
EVENT_BUTTON  id=1020  fwd_id=LED:1044  type=NoteOn key=71 chn=1  rgb=0:0:15 lcd_pos=4:1:4 label="^std_btn"
EVENT_BUTTON  id=1021  fwd_id=LED:1045  type=NoteOn key=72 chn=1  rgb=0:0:15 lcd_pos=5:1:4 label="^std_btn"
EVENT_BUTTON  id=1022  fwd_id=LED:1046  type=NoteOn key=73 chn=1  rgb=0:0:15 lcd_pos=6:1:4 label="^std_btn"
EVENT_BUTTON  id=1023  fwd_id=LED:1047  type=NoteOn key=74 chn=1  rgb=0:0:15 lcd_pos=7:1:4 label="^std_btn"
EVENT_BUTTON  id=1024  fwd_id=LED:1048  type=NoteOn key=75 chn=1  rgb=0:0:15 lcd_pos=8:1:4 label="^std_btn"

but as soon as i have this:

EVENT_BUTTON  id=1024  fwd_id=LED:1048  type=NoteOn key=75 chn=1  rgb=0:0:15 lcd_pos=8:1:4 label="^std_btn"

EVENT_LED     hw_id=1

At the bottom of my .NGC it sets every Value in the Collum to 127.

 

 

Now it works.  :rofl:

 

Wow. im so glad i found that...

It took me an entire day! 

Edited by novski
Link to comment
Share on other sites

The tiny line on the end of my script was evil to me today...

EVENT_LED     hw_id=1

Made that when pressing a single button in the first row then all LEDs in that column went on.

 

You might think its not possible, but it took me a day to realize that...  :sad:

Well the wether was not good at all, so didn't miss anything.

best regards, novski

Link to comment
Share on other sites

Hi

Today i tried a new part of my Fadercore, its a Matrix of 8 rows and 16 LEDs. Purposed to be a LED Level-Meter.

To test, i connected just one Row and 16LEDs and hocked a Encoder to a DIN board. So by turning the Encoder i get a Value from 0 to 127.

Then i wanted to make a simple Test like it wold be LEDs around the Encoder. But somehow again, i don't understand why my code doesn't work.

This is my .NGC file:

RESET_HW

LCD "%C"
LCD "@(1:1:1)OLED1"

# Test D-OUT LEDmatrix board

DOUT_MATRIX n=1  rows=8  mirrored_row=0 inverted_sel=0 sr_dout_row=1 sr_dout_sel1=2  sr_dout_sel2=3

# Matrix control by a Encoder connected to DIN
ENC n=1 sr=1 pins=0:1 type=detented2

EVENT_ENC id= 1  fwd_id=LED_MATRIX:1   type=CC chn= 1 cc= 24  lcd_pos=1:1:2 label="^std_enc" LED_MATRIX_PATTERN=1

LED_MATRIX_PATTERN n= 1  pos= 0  pattern=0000000000000000
LED_MATRIX_PATTERN n= 1  pos= 1  pattern=1000000000000000
LED_MATRIX_PATTERN n= 1  pos= 2  pattern=1100000000000000
LED_MATRIX_PATTERN n= 1  pos= 3  pattern=1110000000000000
LED_MATRIX_PATTERN n= 1  pos= 4  pattern=1111000000000000
LED_MATRIX_PATTERN n= 1  pos= 5  pattern=1111100000000000
LED_MATRIX_PATTERN n= 1  pos= 6  pattern=1111110000000000
LED_MATRIX_PATTERN n= 1  pos= 7  pattern=1111111000000000
LED_MATRIX_PATTERN n= 1  pos= M  pattern=1111111100010000
LED_MATRIX_PATTERN n= 1  pos= 8  pattern=1111111110000000
LED_MATRIX_PATTERN n= 1  pos= 9  pattern=1111111111000000
LED_MATRIX_PATTERN n= 1  pos=10  pattern=1111111111100000
LED_MATRIX_PATTERN n= 1  pos=11  pattern=1111111111110000
LED_MATRIX_PATTERN n= 1  pos=12  pattern=1111111111111000
LED_MATRIX_PATTERN n= 1  pos=13  pattern=1111111111111100
LED_MATRIX_PATTERN n= 1  pos=14  pattern=1111111111111110
LED_MATRIX_PATTERN n= 1  pos=15  pattern=1111111111111111

 

I see the Value rising but the LEDs are always ON. Also if i turn "inverted_sel=1" 

 

What am i doing wrong?

 

best regards

novski

Edited by novski
Link to comment
Share on other sites

Btw.: the EVENT_LED "trick" isn't understood at my side, it should work properly without.

 

And if now even such a simple DOUT matrix configuration doesn't work at your side (it looks correct), something seems to be totally wrong.

 

Could it be, that you are using an (old) .NGR script which may overwrite certain configurations?

 

You've edited the right file, and always checked that MBNG didn't report any error or warning during the upload & execution?

 

Or you are using a modified firmware build which causes such problems?

 

Which core module are you using btw.?

 

Best Regards, Thorsten.

Link to comment
Share on other sites

im using a LPC1769 since my STM32F4Disco turned out to be the smal brother...  :pinch:  (its on the way to you now...)

I havent changed or Deleted the Files since a long time so the .NGR was never touched and is empty. 

 

-> i just had to notice that there is a warning and it reports that there is no LED.NGR file. 

[117358.626] [MBNG_FILE_C:8] WARNING: unsupported parameter in DOUT_MATRIX n=1 ... sr_dout_row=1
[117358.666] [MBNG_FILE_C] Event Pool Number of Items: 1
[117358.666] [MBNG_FILE_C] Event Pool Allocation: 41 of 24576 bytes (0%)
[117358.666] Patch 'LED' loaded from SD Card!
[117358.678] [MBNG_FILE_R] /LED.NGR (optional run script) not found
Link to comment
Share on other sites

WARNING: unsupported parameter in DOUT_MATRIX n=1 ... sr_dout_row=1

means: the sr_dout_row parameter doesn't exist.

means: there is no shift register assigned to drive the rows.

means: it makes sense to read in the documentation which parameter allows you to assign the shift register -> http://www.ucapps.de/midibox_ng_manual_ngc.html

means: thereafter there is a higher chance that the LED matrix will work.

 

Best Regards, Thorsten.

Link to comment
Share on other sites

yes. found it. thanks for your patience...

 

for future, this is the correct syntax:

 

RESET_HW

LCD â€%Câ€
LCD â€@(1:1:1)OLED1â€

# Test D-OUT LEDmatrix board

DOUT_MATRIX n=1 rows=8 inverted=1 sr_dout_sel1=1 sr_dout_r1=2 sr_dout_r2=3

# Matrix control by a Encoder connected to DIN
ENC n=1 sr=1 pins=0:1 type=detented2

EVENT_ENC id= 1 fwd_id=LED_MATRIX:1 type=CC chn= 1 cc= 24 lcd_pos=1:1:2 label=“^std_enc†LED_MATRIX_PATTERN=1

LED_MATRIX_PATTERN n= 1 pos= 0 pattern=0000000000000000
LED_MATRIX_PATTERN n= 1 pos= 1 pattern=1000000000000000
LED_MATRIX_PATTERN n= 1 pos= 2 pattern=1100000000000000
LED_MATRIX_PATTERN n= 1 pos= 3 pattern=1110000000000000
LED_MATRIX_PATTERN n= 1 pos= 4 pattern=1111000000000000
LED_MATRIX_PATTERN n= 1 pos= 5 pattern=1111100000000000
LED_MATRIX_PATTERN n= 1 pos= 6 pattern=1111110000000000
LED_MATRIX_PATTERN n= 1 pos= 7 pattern=1111111000000000
LED_MATRIX_PATTERN n= 1 pos= M pattern=1111111100000000
LED_MATRIX_PATTERN n= 1 pos= 8 pattern=1111111110000000
LED_MATRIX_PATTERN n= 1 pos= 9 pattern=1111111111000000
LED_MATRIX_PATTERN n= 1 pos=10 pattern=1111111111100000
LED_MATRIX_PATTERN n= 1 pos=11 pattern=1111111111110000
LED_MATRIX_PATTERN n= 1 pos=12 pattern=1111111111111000
LED_MATRIX_PATTERN n= 1 pos=13 pattern=1111111111111100
LED_MATRIX_PATTERN n= 1 pos=14 pattern=1111111111111110
LED_MATRIX_PATTERN n= 1 pos=15 pattern=1111111111111111
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...
 Share

×
×
  • Create New...