I am asking for your help with a project, I would like to integrate an Arduino to control an existing LED Clock 7Segments . The LED segments operate on 12 volts and are controlled by 3 16-Channel Constant Current LED Sink Driver controllers (JXI5020) (Work on 3.3v)
The clock at actually controlled by a AT32F421K8T7 controller, But i want to Bypass It.
Each controller manages the display of 2 digits.
But there you go, I can't find any library to manage these controllers.
These controllers ( JXI5020) are shift-registered biased. They have a data in and a clock pin, every time you pulse the clock signal the chip will read the data pin, shift all the values over one(hence the shift) and kick the last value out.
This makes interfacing with them really easy, you probably dont need a library. Just disconnect the pins 2 and 3 (looks like you can pull R1 and R2 but double check) and solder in two leads from your micro controller.
Here is some code that should write something to the display
#define clk 12 //define the pins for clk and data here
#define data 10
void setup() {
pinMode(clk, OUTPUT);
pinMode(data, OUTPUT);
digitalWrite(data, false);
digitalWrite(clk, false);
}
void loop() {
//will continuely update display alternating on/off segments
digitalWrite(data, !digitalRead(data));//toggle data
delay(1);
digitalWrite(clk, true);//pulse clk
delay(1);
digitalWrite(clk, false);
delay(250);//delay between updates
}
Thanks a lot for your answer !
In fact, the code you gave me causes all the segments to light up, which end up going out one by one. and the extinction delay between each segment changes when I change the delay (250).
In order to write numbers you need to first figure out which output is connected to which segment of the display. Once you have that you can implements some code that looks like this:
#define clk 12 //define the pins for clk and data here
#define data 10
int number[] = { 1, 1, 1, 0, 1, 0, 0 }; //define diffrent numbers here
void pulseClk() {//toggles clk
digitalWrite(clk, true); //pulse clk
delay(1);
digitalWrite(clk, false);
}
void sendNumber(int segments[]) {//writes out the given number to the display
for (int i = 0; i < 7; i++) {
digitalWrite(data, segments[i]);
pulseClk();
}
}
void setup() {
pinMode(clk, OUTPUT);
pinMode(data, OUTPUT);
digitalWrite(data, false);
digitalWrite(clk, false);
sendNumber(number);
}
void loop() {
}
If you change the 1s and 0s in the array you can get different segments to display
Great, it works! Thanks to your code, I was able to identify the different segments! I can display the numbers, however, the controller needs to manage 16 segments at the same time to display a correct number. Is there a function that would allow me to add the numbers to send them to the controller?
Unfortunately no, the way these work you cant update part of it at a time, you have to update the whole thing. This shouldn't be too much of a problem though, they should be fast enough that you cant notice the delay.
I see you modified the code to update the whole controller at once. You will have to change it to update only the 8 segments you need at a time, then feed in two number every time you update it. You will also probably need a 'blank' number with all 0s to turn off the numbers when you dont need them.
The part has a latch pin (LE, pin 4) and so should operate much like a 74HC595 (basically, 3-pin control) - this means no flashing while the new data is shifted in. Old data is output until LE is toggled then new data is presented immediately, no intermediate display. Refer to the timing diagram on manual page 4.