Hi Guys,
I got old PCB with LEDS (16x RGB leds and 16x white leds) and 4 MBI5025 chip(R, G, B and W). MBI5025 are normal shift register(16 outs, 16 bits), so normally no problem, but : ;D
I think there is 2 data lines (with 2 MBI5025 on each lines), but only one clock and latch line.
I have 5 pins on the PCB to control the 4 MBI5025, I think it's :
- DATA1
- DATA2
- CLOCK
- LATCH
- Output Enable (just to switch on/off all leds, it's a MBI feature), must be LOW.
With this code, I can make work the data lines (2 MBI5025) separately (I have just to change the pin for the other data line) :
#define SDI 8
#define SDI2 9
#define CLK 10
#define LE 11
#define OE 5
void setup()
{
Serial.begin(9600);
pinMode(SDI, OUTPUT);
pinMode(SDI2, OUTPUT);
pinMode(CLK, OUTPUT);
pinMode(LE, OUTPUT);
pinMode(OE, OUTPUT);
digitalWrite(OE, LOW);
}
void loop()
{
Serial.println("1");
Out(B00000001, B00000001, B00000001, B00000001);
delay(1000);
Serial.println("0");
Out(B00000000, B00000000, B00000000, B00000000);
delay(1000);
}
void Out(byte data1, byte data2, byte data3, byte data4) {
shiftOut(SDI, CLK, MSBFIRST, data4);
//shiftOut(SDI2, CLK, MSBFIRST, data4);
shiftOut(SDI, CLK, MSBFIRST, data3);
//shiftOut(SDI2, CLK, MSBFIRST, data3);
shiftOut(SDI, CLK, MSBFIRST, data2);
//shiftOut(SDI2, CLK, MSBFIRST, data2);
shiftOut(SDI, CLK, MSBFIRST, data1);
//shiftOut(SDI2, CLK, MSBFIRST, data1);
digitalWrite(LE, HIGH);
delayMicroseconds(1);
digitalWrite(LE, LOW);
}
But I don't know how to make all working, if I uncomment "SDI2" lines of the codes, strange things appear.
Thanks for all !