ssp

multiple Clcd's

48 posts in this topic

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

Share this post


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

Share this post


Link to post
Share on other sites

Look at that, even the things I thought I knew were wrong!! I never cease to amaze myself 

Share this post


Link to post
Share on other sites

My brain may have clicked today, not 100% sure yet but I sat talking the code to myself and it started making sense. Will post some up later after trying it or vice versa... 

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

 

Share this post


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

Share this post


Link to post
Share on other sites

the first two 3 digits on cc 16 and cc17 on the first dout work fine, the second dout is not working.. cant figure out why, all new wires and another new dout pcb as well.

Share this post


Link to post
Share on other sites
14 hours ago, latigid on said:

I have got 4 working on the one DOUT but none on the second. Wierd. 

 

IMG_20200128_213659_resized_20200128_093747844.jpg

Share this post


Link to post
Share on other sites

second dout connected digits showing on first display but not second. getting there.

Share this post


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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Just put the Ainser64 together only to realise I hadn't ordered the Ic's... gutting..  now ordered for delivery tomorrow. whats one night waiting for parts...

Share this post


Link to post
Share on other sites

Working just got the 3 digit displays running after some advice and help from Thorsten. Just doing the dance, code to follow. 

 

IMG_20200217_194843.jpg

Share this post


Link to post
Share on other sites

just got the ainser 64 running set it to a single pot for now to test.

and here we go!!..

EOL

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