Go Down

Topic: Arbitrary output issue for 2 different 4 Bit 8x8 LED (Read 331 times) previous topic - next topic

Bin-Matloob

Dear,
Im using 2 no. of 4 Bit 8x8 led (max7219 integrated) by arduino UNO with Lib (https://github.com/MajicDesigns/MD_MAX72XX).

Both 4 Bit 8x8 Led cube working fine in daisy chain... or single also.
I want arbitrary output on both 4 bit 8x8... Like "Hello" on 1 one 4 Bit 8x8 and "World" on 2nd one 4 Bit 8x8. but when I'am doing the same both module all LED continuing glow... (img attached)

im using below code as lib suggested...

Code: [Select]

// Program to demonstrate the MD_Parola library
//
// Simplest program that does something useful - Hello World!
//
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 8
#define CLK_PIN   13
#define CS_PIN    10


int DATA_PIN = 11;
int DATA_PIN1 = 9;

// Hardware SPI connection
//MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary output pins
 MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
 MD_Parola R = MD_Parola(HARDWARE_TYPE, DATA_PIN1, CLK_PIN, CS_PIN, MAX_DEVICES);
void setup(void)
{
  P.begin();
 P.displayText("Hello", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
  
  R.begin();
 R.displayText("World", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
}

void loop(void)
{
  P.displayAnimate();
R.displayAnimate();
  
}



 


I believe I'am making some error in code... or u can suggest any other lib for same output.

Thanks in Advance

Paul__B


That doesn't look useful at all.

So you are using the test code that is supposed to animate, but you haven't managed to get it to even initialise (blank) the displays.  Is that right?  

Re-check all connections.  Perhaps a photo with the lights on.

noiasca

have you seen this configuration anywhere in the examples???

#define CS_PIN    10
int DATA_PIN = 11;
int DATA_PIN1 = 9;

for usual, you would define separate CS_PIN for each single module, but use the same DATA_PIN for both modules.
I've never done that with MAX7219 modules before, but that's how you would treat SPI devices

by the way, this doesn't look correct for your new configuration with two separate objects
#define MAX_DEVICES 8
DE: Wie man Fragen postet:
1. was hat man (Sketch und Hardware)
2. was SOLL es machen
3. was macht es: IST (Fehlverhalten, Fehlermeldungen, Serial.Output ...)
4. Eine Frage stellen bzw. erklären was man erwartet

Bin-Matloob

@paul:  I want different diferent output on different 8x8. All connections are correct bcause modules are working seprately


@noisca: What I know CS is for unabling only.... I had have used same CS for all 7segments.

How its possible if I used Same DIn for two different 8x8 , the output will different ???

noiasca

What I know CS is for unabling only.... I had have used same CS for all 7segments.
if you want all 8 chips as one object you will use only one CS.

if you split into 2 x 4 chips - as I interpreted your post so far, you need different CS lines for each 4xModule.


How its possible if I used Same DIn for two different 8x8 , the output will different ???
SPI shares DI and SCK, but CS - Chip Select - selects the chip.
Simplified: If a chip isn't selected by CS, it does not react on data coming from DI.
so you have to connect DI and SCK to both modules first chips, but you have to use different CS for the two modules.

If it is still unclear, make a clear picture of your wiring (paper is fine) - where we can identify your wiring.

DE: Wie man Fragen postet:
1. was hat man (Sketch und Hardware)
2. was SOLL es machen
3. was macht es: IST (Fehlverhalten, Fehlermeldungen, Serial.Output ...)
4. Eine Frage stellen bzw. erklären was man erwartet

Bin-Matloob

Ok @noiasca, I will do this once reach at work station... and will let u know status...

Paul__B

@paul:  I want different diferent output on different 8x8. All connections are correct because modules are working separately
I am a trifle puzzled as to what you mean by "working".  You showed a picture of displays with all LEDs uniformly lit.  That does not suggest to me that they are "working".  Are you in fact able to produce text scrolling uniformly across the two units?  If so, that is a start.

We await Marco's comments here, but I would not be entirely surprised if his code is indeed able to show two (or more) displays in sub-sections of a single chain of MAX7219 "FC16" modules.

Bin-Matloob

I am a trifle puzzled as to what you mean by "working".  You showed a picture of displays with all LEDs uniformly lit.  That does not suggest to me that they are "working".  Are you in fact able to produce text scrolling uniformly across the two units?  If so, that is a start.

We await Marco's comments here, but I would not be entirely surprised if his code is indeed able to show two (or more) displays in sub-sections of a single chain of MAX7219 "FC16" modules.
ohhh...come on.. @paul... here my working means doesn't that what u said... but if I run it individual than both r working...

Bin-Matloob

if you want all 8 chips as one object you will use only one CS.

if you split into 2 x 4 chips - as I interpreted your post so far, you need different CS lines for each 4xModule.



SPI shares DI and SCK, but CS - Chip Select - selects the chip.
Simplified: If a chip isn't selected by CS, it does not react on data coming from DI.
so you have to connect DI and SCK to both modules first chips, but you have to use different CS for the two modules.

If it is still unclear, make a clear picture of your wiring (paper is fine) - where we can identify your wiring.


Im half reached to my goal...

Im selecting int MAX_DEVICES = 4; than Hello on 1st module like eye blink and gone... and World on 2nd module display fine....

if im selecting int MAX_DEVICES = 8; than on 1st module "low" is comig... and 2nd module Showing "rld"... which is obvious...

img attached for both scenario...

this time I make separate CS and Din....

updated code below

Code: [Select]

// Program to demonstrate the MD_Parola library
//
// Simplest program that does something useful - Hello World!
//
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
int MAX_DEVICES = 4;
//int MAX_DEVICES = 8;

int CLK_PIN  = 13;
int DATA_PIN  =11;
int CS_PIN   = 10;


int DATA_PIN1 = 8;
int CS_PIN1   = 9;


// Hardware SPI connection
//MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary output pins
 MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
 MD_Parola Q = MD_Parola(HARDWARE_TYPE, DATA_PIN1, CLK_PIN, CS_PIN1, MAX_DEVICES);
void setup()
{
 Dis1();
 Dis2();
 
}

void loop()
{
 
 
}

void Dis1()
{


  P.begin();
  P.displayText("Hellow", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
P.displayAnimate();
 
}

void Dis2()
{


   Q.begin();
  Q.displayText("World", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
Q.displayAnimate();
 
}

 
 
waiting eagerly for your response....  :(

Bin-Matloob

Yessssssssssss......


This time I win...

Its run....like what I want...


Only the mistake I was giving pwr arduino with usb...so it was eye blink..
external power solved it..

img attached


Thanks all for valuable time....

Bin Matloob

Paul__B


Bin-Matloob



Ahh, now that's a useful photo.  :smiley-lol:
Dear @Paul @noiasca,
im using below code...for this display... but it stopping after few minutes.... like hanged...

any error in code? or shall I initiate a new topic?





Code: [Select]


// Program to demonstrate the MD_Parola library
//
// Simplest program that does something useful - Hello World!
//
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
int MAX_DEVICES = 4;


int CLK_PIN  = 13;
int DATA_PIN  =11;
//int CS_PIN   = 10;


//int DATA_PIN1 = 8;
int CS_PIN1   = 9;


// Hardware SPI connection
//MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary output pins
 MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
 MD_Parola Q = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN1, MAX_DEVICES);
void setup()
{

 
}

void loop()
{
Dis1();
delay(5000);
Dis1_Class();
delay(5000);
}

void Dis1()
{


  P.begin();
  P.displayText("MATHS", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
  P.displayAnimate();

   Q.begin();
  Q.displayText("HINDI", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
Q.displayAnimate();


}


void Dis1_Class()
{

  P.begin();
   P.displayText("12 A", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
P.displayAnimate();
Q.begin();
    Q.displayText("5 B", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
Q.displayAnimate();

}




noiasca

nothing in the setup()???

Where have you put your .begin ...
Oh it's in the function.
ah you call the function in the loop

I assume you should call the .begin method only ONCE in the setup for each string

and finally,
check your .displayAnimate();
It should be enough to call it in your function OR in the loop.



DE: Wie man Fragen postet:
1. was hat man (Sketch und Hardware)
2. was SOLL es machen
3. was macht es: IST (Fehlverhalten, Fehlermeldungen, Serial.Output ...)
4. Eine Frage stellen bzw. erklären was man erwartet

Go Up