Hi everybody,
my first post in which im strongly requesting your help, even though it is a bit to read...
I have some Problems with my Arduino controlling an mixture of LEDs and 7-Segment displays arranged in an Matrix. I am really desperate about it because I have tested a lot of arrangements and switching the code. But nothing really helped. So any help, tips or comments are appreciated!!
The facts:
As i said, I have some LEDs and 7-Segment displays arranged in an matrix. The matrix is controlled by the MIC5891 latched shift register as the source input driver and the MIC5821 as the current sink output driver. (see attached drawing)
The shift registers were before controlled via an IO-Warrior, who shifted the bytes via a serial connection to the registers.
The Matrix was operated in a multiplexing mode by the IO-Warrior.
The Matrix was powered via an external 12V 600mA power supply. The 5V supply for the Micrel Shift registers are supplied by an external power supply. The arrangement was working very fine during the last 7 years. But now it was time to modernize it.
The trial:
To test my idea, I exchanged the IO-Warrior40-Mod Chip with an Arduino Uno R3. To be precise, I removed the IO-Warrior chip from its socket and only connected the OE, CLK, Data and Latch Pin to the Arduino. Then I shifted some Bytes to the MIC shift registers. (see attached code)
My observations:
The LEDs and 7-Segment displays are displaying the right things. But they are glowing very dark.
When I tried to change the delay, e.g. slow it down, the LEDs and 7-Seg start to glow brighter, but they start to flicker (well, they should be, because I am lowerig the refresh rate an the persistance of vision is not applicable any more). But you have an display like an old flickering CRT-Display. So unusable to me.
What am I doing wrong? I changed nothing on the power supply. I just changed the way, the shift registers are getting their 0s and 1s. Why are the LEDs so dark when I use the Arduino???
I even tried it with an SPI connection....same problem.
I've tried it with an constantly tied high latch pin and an constantly tied low OE pin.....no improvement.
I've tried to change the digitalWrite()
function, because i have read it could be to slow under some conditions...no improvement
I've even put the IO-Warrior back in its socket and tried to run it, because i thought, i've might broken something....but everything worked fine....
Why can't I change the one Microcontroller(IO-Warrior) with another one(Arduino Uno) and everything works...this seems not logical to me... :~
One of the Codes I used:
const int LATCH = 10; //Latch/Strobe
const int OE = 12; //OE (Output Enable)
const int DOUT = 11; //Data
const int CLK = 9; //Clock
int delayMicrosecondstime=16383;
void setup()
{
pinMode(CLK,OUTPUT);
pinMode(LATCH,OUTPUT);
pinMode(DOUT, OUTPUT);
pinMode(OE, OUTPUT);
//7-Segment Display Init
digitalWrite(LATCH,LOW);
digitalWrite(LATCH,HIGH);
digitalWrite(OE,HIGH);
}
void loop() {
/*
This is an version with the Latch pin constantly tied high
*/
digitalWrite(OE,HIGH);
//digitalWrite(LATCH,HIGH);
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //X
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //a
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //B
shiftOut(DOUT, CLK, MSBFIRST, B01011011); //c
shiftOut(DOUT, CLK, MSBFIRST, B00000010); //d
// digitalWrite(LATCH, LOW);
digitalWrite(OE, LOW);
delayMicroseconds(delayMicrosecondstime);
digitalWrite(OE,HIGH);
// digitalWrite(LATCH,HIGH);
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //X
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //a
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //B
shiftOut(DOUT, CLK, MSBFIRST, B01001111); //c
shiftOut(DOUT, CLK, MSBFIRST, B00000100); //d
// digitalWrite(LATCH, LOW);
digitalWrite(OE, LOW);
delayMicroseconds(delayMicrosecondstime);
digitalWrite(OE,HIGH);
// digitalWrite(LATCH,HIGH);
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //X
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //a
shiftOut(DOUT, CLK, MSBFIRST, B00000000); //B
shiftOut(DOUT, CLK, MSBFIRST, B00111111); //c
shiftOut(DOUT, CLK, MSBFIRST, B00001000); //d
// digitalWrite(LATCH, LOW);
digitalWrite(OE, LOW);
delayMicroseconds(delayMicrosecondstime);
/*
and so on
and so on....
*/
}