Jump to content

multiple Clcd's


ssp

Recommended Posts

2 hours ago, latigid on said:

Could be anything from incomplete NGC file, dodgy breadboard or wiring, corrupt SD card (saving often doesn't work well, upload always worked better for me) etc. etc. 

Draw a functional map of how it should work and see if you connected the dots properly. Adapt the NGC file to suit your hardware and again just playing with it might help.

I have buzzed all of the cables to and from the breadboard, checked the dout pcb, (i even soldered a new one up and changed out all the sr's on the old one) all is good connectivity wise.  I am trying hard to understand this, What i have done is create a test.ngc file on my sd card and i run all my test code from that in mios studio, same as the first steps examples did. most of the things i have done since starting to learn i have done this way and have worked.

I dont hide the fact i am not a coder and where it gets more complex i struggle yet, i push on but yes i know its annoying I have to ask questions along the way but I dont expect anyone to do do the work for me.

I work off examples, that way i can try it, figure it out by messing with it and hey presto it clicks, like the padding and syntax for the lcd's and oleds. It took a while but after playing with the examples and trying a few modifications it all clicked and I understood it all, the same with mapping potentiometers and encoders etc and their types, values etc. i have all of that down and i use it fine.

I just need to figure out the matrix syntax etc and as soon as i do.. it will click.

for example:

n=<1..8>Specifies the matrix number which should be configured; it can range from 1..8 ( this i dont understand)

rows=<4|8|16>Sets the number of rows which should be scanned: (this i dont understand)

This is think I understand

sr_dout_sel1=<0..16> Sets the first DOUT shift register which should output the row selection signals ( if this =1 then this means the 7 segments goto sr=1)

sr_dout_r1=<0..16>Sets the first DOUT shift register of the LED matrix row. (if r1=1 then the first shift register on the doutx4 pcb is number 1)

Where do i assign the common cathodes? as they would link to J4 the second shift register that has no pullup resistors in just bridges.

I also looked at this schematic and it blew my mind!!  http://ucapps.de/mbhp/mbhp_blm_map.pdf

Link to comment
Share on other sites

Hi,

 

3 minutes ago, ssp said:

n=<1..8>Specifies the matrix number which should be configured; it can range from 1..8 ( this i dont understand)

Defines the matrix to be addressed. You could have one matrix for 7-seg digits and another as a simple LED dot matrix. Each one needs a unique address, otherwise MIOS wouldn't know what one to turn on when assigned.

 

Quote

rows=<4|8|16>Sets the number of rows which should be scanned: (this i dont understand)

Simple case: 8 rows is typical. 4 rows will repeat the selection pulses. 16 rows would need two SRs for 16 selection pulses. Use rows-8 unless you need a 16x16 matrix.

 

Quote

This is think I understand

sr_dout_sel1=<0..16> Sets the first DOUT shift register which should output the row selection signals ( if this =1 then this means the 7 segments goto sr=1)

Determine where the common pin of your LED segments go. Then connect them to this SR in order. If it is the first SR in the chain, then sr_dout_sel1=1. If it is the nth SR in the chain, then sr_dout_sel1=n

 

Quote

sr_dout_r1=<0..16>Sets the first DOUT shift register of the LED matrix row. (if r1=1 then the first shift register on the doutx4 pcb is number 1)

r1 refers to red1, for the case where you're defining an RGB matrix. Then you have g1 and b1, and also r2, g2 and g2 if you want a 16x16 matrix.

 

Quote

Where do i assign the common cathodes? as they would link to J4 the second shift register that has no pullup resistors in just bridges.

Not pull-up resistors, these are series resistors to limit the current and they probably should be bridges to sink more current for the common cathodes. So assign the sr_dout_sel1=n where those bridges are. 

If you have common cathodes, then 

inverted_sel=0

is probably correct. At least that is the case for matrices that I have configured (not including those with sink drivers!)

 

Quote

I also looked at this schematic and it blew my mind!!  http://ucapps.de/mbhp/mbhp_blm_map.pdf

Tell me about it!

Have fun!
Andy

Link to comment
Share on other sites

I am pleased to say that I finally understand the dout matrix syntax and structure for what i want., I am going to have a play with it now but this is a single 3 digit lcd on a doutx4 on the first shift register.

RESET_HW

LCD "Single CLED 3 Digit"

DOUT_MATRIX n=1   rows=8   sr_dout_r1=1  inverted_row=0  mirrored_row=0  sr_dout_sel1=2  inverted_sel=0

EVENT_LED_MATRIX id=1  fwd_id=LED_MATRIX:2  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:2  label="1:%3d%B"
EVENT_LED_MATRIX id=2  fwd_id=LED_MATRIX:3  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=3                       led_matrix_pattern=Digit3

My code, all is good, I changed the code so it moves to the 3rd shift register and the commons on sr=4

RESET_HW

LCD "Single CLED 3 Digit"

DOUT_MATRIX n=1   rows=8   sr_dout_r1=3  inverted_row=0  mirrored_row=0  sr_dout_sel1=4  inverted_sel=0

EVENT_LED_MATRIX id=1  fwd_id=LED_MATRIX:2  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:2  label="1:%3d%B"
EVENT_LED_MATRIX id=2  fwd_id=LED_MATRIX:3  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=3                       led_matrix_pattern=Digit3

 

ALL IS GOOD!!!  my brain worked today. I am just reading how to forward from an encoder to this event now. wish me luck!!

 

Many thanks to latigid-on for his patience and help so far.

Link to comment
Share on other sites

Encoder all hooked up and forwarding to the 3 digit display and the oled display!! cookie for me tonight!

RESET_HW

LCD "Single CLED 3 Digit"

DOUT_MATRIX n=1   rows=8   sr_dout_r1=3  inverted_row=0  mirrored_row=0  sr_dout_sel1=4  inverted_sel=0

EVENT_LED_MATRIX id=1  fwd_id=LED_MATRIX:2  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:2  label="1:%3d%B"
EVENT_LED_MATRIX id=2  fwd_id=LED_MATRIX:3  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=3                       led_matrix_pattern=Digit3

ENC n=  1   sr=1 pins=0:1   type=non_detented
EVENT_ENC id=1  fwd_id=LED_MATRIX:1 type=CC chn= 1 cc= 1

dance.jpg

Edited by ssp
Link to comment
Share on other sites

Just now, latigid on said:

POIDH!

I just hooked up a second 3 digit and moved the encoder over as well. it worked first time, the second 3 digit is just linked to the first on the row pins and the commons to the next 3 on the sel pins.

RESET_HW

LCD "Single CLED 3 Digit"

DOUT_MATRIX n=1   rows=8   sr_dout_r1=3  inverted_row=0  mirrored_row=0  sr_dout_sel1=4  inverted_sel=0

ENC n=  1   sr=1 pins=0:1   type=non_detented
ENC n=  2   sr=1 pins=2:3   type=non_detented

EVENT_ENC id=1  fwd_id=LED_MATRIX:1 type=CC chn= 1 cc= 16
EVENT_ENC id=2  fwd_id=LED_MATRIX:4 type=CC chn= 1 cc= 17

EVENT_LED_MATRIX id=1  fwd_id=LED_MATRIX:2  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:2  label="1:%3d%B"
EVENT_LED_MATRIX id=2  fwd_id=LED_MATRIX:3  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=3                       led_matrix_pattern=Digit3


EVENT_LED_MATRIX id=4  fwd_id=LED_MATRIX:5  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 17  lcd_pos=1:1:2  label="2:%3d%B"
EVENT_LED_MATRIX id=5  fwd_id=LED_MATRIX:6  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=6                       led_matrix_pattern=Digit3

thumbnail.jpg

 

now i see it I can't unsee it!!

Edited by ssp
Link to comment
Share on other sites

Dout question just wondering if this is right:

If i connect two dout pcbs then this works fine for the first one

DOUT_MATRIX n=1   rows=8   sr_dout_r1=1  inverted_row=0  mirrored_row=0  sr_dout_sel1=2  inverted_sel=0

is this correct for a second connected dout?


DOUT_MATRIX n=2   rows=8   sr_dout_r2=1  inverted_row=0  mirrored_row=0  sr_dout_sel2=2  inverted_sel=0

 

Dout pcb 2 pins start from 33 - 64

so should the next section for the led matrix be?

EVENT_LED_MATRIX id=33  fwd_id=LED_MATRIX:34  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:2  label="1:%3d%B"
EVENT_LED_MATRIX id=34  fwd_id=LED_MATRIX:35  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=35                       led_matrix_pattern=Digit3

I am going to make another dout pcb tomorrow to test this anyway. I see in the manual it says this:

sr_dout_r2=<0..16> sets the (optional) second dout shift register of the led matrix row

sr_dout_sel2=<0..16> set to 0 if second is not required.

Edited by ssp
Link to comment
Share on other sites

sr_dout_r1= is for 8x matrices
sr_dout_r2= is for 16x matrices

I suppose you only use 8x8 matrices, thus keep sr_dout_r1 for the second DOUT.

Here's how you address one DOUT PCB:
sr_dout_r1=1
sr_dout_r1=2
sr_dout_r1=3
sr_dout_r1=4

and here's how you address the next DOUT:
sr_dout_r1=5
sr_dout_r1=6
...

Link to comment
Share on other sites

1 hour ago, latigid on said:

sr_dout_r1= is for 8x matrices
sr_dout_r2= is for 16x matrices

I suppose you only use 8x8 matrices, thus keep sr_dout_r1 for the second DOUT.

Here's how you address one DOUT PCB:
sr_dout_r1=1
sr_dout_r1=2
sr_dout_r1=3
sr_dout_r1=4

and here's how you address the next DOUT:
sr_dout_r1=5
sr_dout_r1=6
..

I thought it was but, the manual isn't specific at that point so I wanted to check. I will give it a run later.

I assume the DOUT_MATRIX n= also changes?

DOUT_MATRIX n=1   rows=8   sr_dout_r1=1  inverted_row=0  mirrored_row=0  sr_dout_sel1=2  inverted_sel=0
DOUT_MATRIX n=2   rows=8   sr_dout_r1=3  inverted_row=0  mirrored_row=0  sr_dout_sel1=4  inverted_sel=0
DOUT_MATRIX n=3   rows=8   sr_dout_r1=5  inverted_row=0  mirrored_row=0  sr_dout_sel1=6  inverted_sel=0
DOUT_MATRIX n=4   rows=8   sr_dout_r1=7  inverted_row=0  mirrored_row=0  sr_dout_sel1=8  inverted_sel=0

 

Also!!  on the old core8 i could connect 4 doutx4 can you connect 4 to the mb_ng??

Edited by ssp
Link to comment
Share on other sites

5 hours ago, latigid on said:

sr_dout_r1= is for 8x matrices
sr_dout_r2= is for 16x matrices

I suppose you only use 8x8 matrices, thus keep sr_dout_r1 for the second DOUT.

Here's how you address one DOUT PCB:
sr_dout_r1=1
sr_dout_r1=2
sr_dout_r1=3
sr_dout_r1=4

and here's how you address the next DOUT:
sr_dout_r1=5
sr_dout_r1=6
..

I thought it was but, the manual isn't specific at that point so I wanted to check. I will give it a run later. Tx

 

EDIT: Ok looking through some old threads I see that it is n=1/2/3/4 etc. I'm good there. 

Link to comment
Share on other sites

11 hours ago, latigid on said:

r_dout_r1= is for 8x matrices
sr_dout_r2= is for 16x matrices

I suppose you only use 8x8 matrices, thus keep sr_dout_r1 for the second DOUT.

Here's how you address one DOUT PCB:
sr_dout_r1=1  sr_dout_sel1=2
sr_dout_r1=3  sr_dout_sel1=4
sr_dout_r1=5  sr_dout_sel1=6
sr_dout_r1=7 

and here's how you address the next DOUT:
sr_dout_r1=5
sr_dout_r1=6
...

ah now, looking at this again.. wouldnt it be like this? as the 2nd sr is for the common selectors.

sr_dout_r1=1  sr_dout_sel1=2
sr_dout_r1=3  sr_dout_sel1=4
sr_dout_r1=5  sr_dout_sel1=6
sr_dout_r1=7  sr_dout_sel1=8

 

Link to comment
Share on other sites

ok ran the code, it didnt work, will have to look into this a bit more.

is this correct?


# Control 5x3 LED Digits to output 7bit values

RESET_HW

LCD "%CLED Digit Demo"

# HW definitions for "Common Cathode" Digits


DOUT_MATRIX n=1   rows=8   sr_dout_r1=1  inverted_row=0  mirrored_row=0  sr_dout_sel1=2  inverted_sel=0
DOUT_MATRIX n=2   rows=8   sr_dout_r1=3  inverted_row=0  mirrored_row=0  sr_dout_sel1=4  inverted_sel=0
DOUT_MATRIX n=3   rows=8   sr_dout_r1=5  inverted_row=0  mirrored_row=0  sr_dout_sel1=6  inverted_sel=0
DOUT_MATRIX n=4   rows=8   sr_dout_r1=7  inverted_row=0  mirrored_row=0  sr_dout_sel1=8  inverted_sel=0

 

# these can be changed for each 3 digits to test connectivity
ENC n=  1   sr=1 pins=0:1   type=non_detented
ENC n=  2   sr=1 pins=2:3   type=non_detented

EVENT_ENC id=1  fwd_id=LED_MATRIX:1 type=CC chn= 1 cc= 16
EVENT_ENC id=2  fwd_id=LED_MATRIX:4 type=CC chn= 1 cc= 17


# First Value (3 digits) received via CC#16
EVENT_LED_MATRIX id=1  fwd_id=LED_MATRIX:2  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:2  label="1:%3d%B"
EVENT_LED_MATRIX id=2  fwd_id=LED_MATRIX:3  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=3                       led_matrix_pattern=Digit3

# Second Value (3 digits) received via CC#17
EVENT_LED_MATRIX id=4  fwd_id=LED_MATRIX:5  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 17  lcd_pos=1:1:2  label="2:%3d%B"
EVENT_LED_MATRIX id=5  fwd_id=LED_MATRIX:6  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=6                       led_matrix_pattern=Digit3

# Third Value (3 digits) received via CC#18
EVENT_LED_MATRIX id=17  fwd_id=LED_MATRIX:18  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 18  lcd_pos=1:1:2  label="3:%3d%B"
EVENT_LED_MATRIX id=18  fwd_id=LED_MATRIX:19 led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=19                      led_matrix_pattern=Digit3

# Fourth Value (3 digits) received via CC#19
EVENT_LED_MATRIX id=20 fwd_id=LED_MATRIX:21 led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 19  lcd_pos=1:1:2  label="4:%3d%B"
EVENT_LED_MATRIX id=21 fwd_id=LED_MATRIX:22 led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=22                      led_matrix_pattern=Digit3

# Fifth Value (3 digits) received via CC#20 (this is to test the first row on the second dout pcb)
EVENT_LED_MATRIX id=33 fwd_id=LED_MATRIX:34 led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 19  lcd_pos=1:1:2  label="4:%3d%B"
EVENT_LED_MATRIX id=34 fwd_id=LED_MATRIX:35 led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=35                      led_matrix_pattern=Digit3

Edited by ssp
Link to comment
Share on other sites

Ok all is working i made a couple of mistakes in the code, duplicated #cc etc. But all is looking good now. I read up some more and can connect upto 8 doutx4 so that is great, now i just need to order some more doutx4 boards.

 

My Plan is now to condense this thread into a more useful one or make a blog and edit out everything that is duplicated or un-needed.

 

corrected code working over two doutx4, this has allowed me to learn and test the Dout_Matrix configuration on the MB_NG.

RESET_HW

LCD "%CLED Digit Demo"

# HW definitions for "Common Cathode" Digits


DOUT_MATRIX n=1   rows=8   sr_dout_r1=1  inverted_row=0  mirrored_row=0  sr_dout_sel1=2  inverted_sel=0
DOUT_MATRIX n=2   rows=8   sr_dout_r1=3  inverted_row=0  mirrored_row=0  sr_dout_sel1=4  inverted_sel=0
DOUT_MATRIX n=3   rows=8   sr_dout_r1=5  inverted_row=0  mirrored_row=0  sr_dout_sel1=6  inverted_sel=0
DOUT_MATRIX n=4   rows=8   sr_dout_r1=7  inverted_row=0  mirrored_row=0  sr_dout_sel1=8  inverted_sel=0


# these can be changed for each 3 digits to test connectivity
ENC n=  1   sr=1 pins=0:1   type=non_detented
ENC n=  2   sr=1 pins=2:3   type=non_detented

EVENT_ENC id=1  fwd_id=LED_MATRIX:1 type=CC chn= 1 cc= 16
EVENT_ENC id=2  fwd_id=LED_MATRIX:4 type=CC chn= 1 cc= 17


# First Value (3 digits) received via CC#16
EVENT_LED_MATRIX id=1  fwd_id=LED_MATRIX:2  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 16  lcd_pos=1:1:2  label="1:%3d%B"
EVENT_LED_MATRIX id=2  fwd_id=LED_MATRIX:3  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=3                       led_matrix_pattern=Digit3

# Second Value (3 digits) received via CC#17
EVENT_LED_MATRIX id=4  fwd_id=LED_MATRIX:5  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 17  lcd_pos=1:1:2  label="2:%3d%B"
EVENT_LED_MATRIX id=5  fwd_id=LED_MATRIX:6  led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=6                       led_matrix_pattern=Digit3

# Third Value (3 digits) received via CC#18
EVENT_LED_MATRIX id=17  fwd_id=LED_MATRIX:18  led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 18  lcd_pos=1:1:2  label="3:%3d%B"
EVENT_LED_MATRIX id=18  fwd_id=LED_MATRIX:19 led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=19                      led_matrix_pattern=Digit3

# Fourth Value (3 digits) received via CC#19
EVENT_LED_MATRIX id=20 fwd_id=LED_MATRIX:21 led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 19  lcd_pos=1:1:2  label="4:%3d%B"
EVENT_LED_MATRIX id=21 fwd_id=LED_MATRIX:22 led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=22                      led_matrix_pattern=Digit3

# Fifth Value (3 digits) received via CC#20 (this is to test the first row on the second dout pcb)
EVENT_LED_MATRIX id=33 fwd_id=LED_MATRIX:34 led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 20  lcd_pos=1:1:2  label="5:%3d%B"
EVENT_LED_MATRIX id=34 fwd_id=LED_MATRIX:35 led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=35                      led_matrix_pattern=Digit3

# Sixth Value (3 digits) received via CC#21 (this is to test the first row on the second dout pcb)
EVENT_LED_MATRIX id=36 fwd_id=LED_MATRIX:37 led_matrix_pattern=Digit1  fwd_to_lcd=1  type=CC chn= 1 cc= 21  lcd_pos=1:1:2  label="6:%3d%B"
EVENT_LED_MATRIX id=37 fwd_id=LED_MATRIX:38 led_matrix_pattern=Digit2
EVENT_LED_MATRIX id=38                      led_matrix_pattern=Digit3

Edited by ssp
Link to comment
Share on other sites

  • 3 weeks later...

With a nudge in the right direction from thorsten i managed to get this working today to a certain extent.

Using senders and maps i have got it working however the 128bit for encoders is the problem.

I did see that there is a resolution setting for pots, so perhaps i can edit this to my advantage, I am just going to build my ainser64 board and give it a try. using this section of the manual

MAP<n>/HWORDI  Applies linear interpolation between data points. Up to 64 datapoints can be specified, the value range is -16384..16383 (16bit).

Example:

# pot is working at 12bit resolution (0..4095)
# 0..2048 should send CC value 127..0 downwards,
# and 2049..4095 (the second half) should send 0..127 upwards.
MAP1/HWORDI 0:127  2048:0    4095:127
Edited by ssp
Link to comment
Share on other sites

  • 2 weeks later...

i got the ainser up and running fine, all the code i ran through it worked first time and it all did what i wanted. I am working on the pcb's this weekend in altium before i send the gerbers to the pcb house, I also found someone to make the front panels for my enclosures as well who makes synth panels in various formats. I will link them in here this weekend.

Picked up some really nice illuminated micro tact switches and for another project some larger size 12v illuminated rectangular switches that i pulled the bulb out and replaced it with a 3mm ultra bright led and it works fine.

Al in all its all looking godd at the moment, I will update with some pics and build designs soon.

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