Go Down

Topic: Please guide (Read 759 times) previous topic - next topic

Lakshmikant

Goodday,
I have daisy chained 11 chips of 595 shift register powering 4 shift register together with 5v, thus powering the project using 3 nos   5v  500mA  DC adapters.  All led to every pin with 100 ohms resistor. the problem is that only 8 shift register display the led pattern from array included in Arduino code. The problem is not the code. As i have shift out to all 11 shift register.

* What is tried is connect each set of 4 shift register to Arduino and every set worked fine.
* Connected two sets, worked fine

when I connect the three set, thats when the third doesnot work, but the two sets display there respective pattern.

Anyone please help or refer me to the similar problem in forum.

Thanking you,

The code as below
Code: [Select]

int dataPin = 11;
int clockPin = 12;
int latchPin = 8;

const byte COL_COUNT = 28;
long long unsigned sequence[COL_COUNT]=
{
0B1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111,
0B1000000000000000000000001110000000000000000000011000000000000000000000001000000000000000,
0B0100000000000000000000000100000000000000000000100100000000000000000000000100000000000000,
0B0010000000000000000000000010000000000000000001000010000000000000000000000010000000000000,
0B0001000000000000000000000001000000000000000010000001000000000000000000000001000000000000,
0B0000100000000000000000000000100000000000000100000000100000000000000000000000100000000000,
0B0000010000000000000000000000010000000000001000000000010000000000000000000000010000000000,
0B0000001000000000000000000000001000000000010000000000001000000000000000000000001000000000,
0B0000000100000000000000000000000100000000100000000000000100000000000000000000000100000000,
0B0000000010000000000000000000000010000001000000000000000010000000000000000000000010000001,
0B0000000001000000000000000000000001000010000000000000000001000000000000000000000001000010,
0B0000000000100000000000000000000000100100000000000000000000100000000000000000000000100100,
0B0000000000010000000000000000000000011000000000000000000000010000000000000000000000011000,
0B0000000000001000000000000000000000101000000000000000000000001000000000000000000000101000,
0B0000000000000100000000000000000001000100000000000000000000000100000000000000000001000100,
0B0000000000000010000000000000000010000010000000000000000000000010000000000000000010000010,
0B0000000000000001000000000000000100000001000000000000000000000001000000000000000100000001,
0B0000000000000000100000000000001000000000100000000000000000000000100000000000001000000000,
0B0000000000000000010000000000010000000000010000000000000000000000010000000000010000000000,
0B0000000000000000001000000000100000000000001000000000000000000000001000000000100000000000,
0B0000000000000000000100000001000000000000000100000000000000000000000100000001000000000000,
0B0000000000000000000010000010000000000000000010000000000000000000000010000010000000000000,
0B0000000000000000000001000100000000000000000001000000000000000000000001000100000000000000,
0B0000000000000000000000101000000000000000000000100000000000000000000000101000000000000000,
0B0000000000000000000000010000000000000000000000010000000000000000000000010000000000000000,
0B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,
};
//unsigned int pattern_index = 0;
//unsigned int pattern_count = sizeof(sequence);



void setup()

{
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(latchPin, OUTPUT);
}

void loop()
{
for (int col=0; col<COL_COUNT; col++)
{
  digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>80);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>72);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>64);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>56);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>48);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>40);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>32);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>24);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>16);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>8);
shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]);

  digitalWrite(latchPin, HIGH);
  delay(1000);
}
//pattern_index ++;
//if (pattern_index >= pattern_count)
//pattern_index = 0;
}




ieee488

Goodday,
I have daisy chained 11 chips of 595 shift register powering 4 shift register together with 5v, thus powering the project using 3 nos   5v  500mA  DC adapters. 

That is clear as mud.

Lakshmikant

 :smiley-confuse:

Sorry,

What i did was,

create 3 pcb with 4 shift register on each board daisychained and powered it with 5v 500mA DC each.

also chained data, clock, latch between 3 pcb too.

Note:

* when connecting each individual pcb to arduino it works

* when connect (daisychain) two pcbs it works fine. leds work as per array.

* when connecting (daisychain) the third pcb to the above, the third pcb led dont work.

thanking you
hope i cleared myself.


Grumpy_Mike

What is the schematic for these boards? Have you got decoupling capacitors on all the chips?

TonyWilk

#4
Jan 12, 2018, 05:37 pm Last Edit: Jan 12, 2018, 05:37 pm by TonyWilk
* when connect (daisychain) two pcbs it works fine. leds work as per array.

* when connecting (daisychain) the third pcb to the above, the third pcb led dont work.
'the third pcb dont work' - does that mean it does nothing at all, or it does something strange ?

If you have two pcbs working fine, what happens when you add the third pcb as first in the line from the arduino ?

Yours,
 TonyWilk

P.S.
Code: [Select]

// after this:
digitalWrite(latchPin, LOW);

// try adding this, so you are shifting all bits to all shift registers:
shiftOut(dataPin, clockPin, MSBFIRST, 0 );


Lakshmikant

thanks for rely,

I was occupied in my pending work, so could not reply back

as per i have decoupling to every ic i will try to upload schematics.


also i tried TonyWilk code and things changed.


update:
the first ic or set of 8 leds on the third pcd is responding  to the pattern in arrray. but the rest 3 sets of leds on the third pcb dont respond.

what i meant to say is first, second and the first 595 ic on the third pcb respond. rest dont



Question: Is it a power issue?   also do i use buffer ic for data, clock and latch. So the chain be like  arduino >  buffer ic > pcbs?

Please help


Grumpy_Mike

Quote
Question: Is it a power issue?
I doubt it, a power issue would not present like this.

Quote
also do i use buffer ic for data, clock and latch.
For three ICs no, the Arduino pins are good for at least 10 to 20 chips.

Jobi-Wan

Code: [Select]

  long long unsigned sequence[COL_COUNT]=
  {
    0B1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111,
    0B1000000000000000000000001110000000000000000000011000000000000000000000001000000000000000,

  [...]

void loop()
{
  for (int col=0; col<COL_COUNT; col++)
  {
      digitalWrite(latchPin, LOW);

    shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>80);
    shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>72);
    shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>64);
    shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>56);
    shiftOut(dataPin, clockPin, MSBFIRST, sequence[col]>>48);


long long is 'only' 64 bits wide, so the values for those first 3 shifts:
sequence[col]>>80, sequence[col]>>72, sequence[col]>>64
are always zero.
Also the 88 bit constants in your array lose their 24 most significant bits.
You should get a warning for that, along the lines of "Integer constant is too large for its type".

TonyWilk

update:
the first ic or set of 8 leds on the third pcd is responding  to the pattern in arrray. but the rest 3 sets of leds on the third pcb dont respond.
Ah... so it's a fault on that pcb.
Bad solder joint, bent pin, cut track, busted chip ?

Yours,
  TonyWilk

Lakshmikant

TonyWilk thanks for pointing me at that direction, did check and found out that there was a trace damaged. Corrected it and also created a new pcb with other 4 shift register.  A total of 16 shift register.


Looking at what Jobi-Wan pointing out is what the real problem.

As i cannot go beyond 8 shift register.

Jobi-Wan or anyone can you please guide me  regarding code or give direction. As I plan to control 50 shift registers pin individually(400 pin).

* can i split the led pattern into 64 bit? or is there another way i can send 400 bits
* create pcb for 8 shift register and send data individually to each.

Please guide
Thanking you in advance.

Lakshmikant

Forgot to add this to the above.

http://bildr.org/2011/08/74hc595-breakout-arduino/

according to the above link it say it can control 2000 pins, then how can we send 2000 bits

Please help

Wawa

Shift registers for that many LEDs?
Addressable LEDs is a lot easier,
or matrixing with the MAX7219 (64 LEDs per chip, and no current limiting resistors).
Leo..

Grumpy_Mike

Quote
then how can we send 2000 bits
The data has to be held in an array. With one byte controlling 8 bits then for 2000 bits you need an array of 250 bytes. You then use a loop to shovel them out one byte at a time.

Lakshmikant

Can you proved me a sample code for atleast 3 shift register, rest i will make it out, please

Grumpy_Mike

#14
Jan 27, 2018, 11:26 pm Last Edit: Jan 27, 2018, 11:28 pm by Grumpy_Mike
Code: [Select]
SPI.transfer(buffer, size)

From https://www.arduino.cc/en/Reference/SPITransfer

Still haven't seen your schematic. Without a schematic all advice can only be general.

Go Up