Hello!
This thread is for the AS1130 LED driver from austria microsystems. There has been an on-going discussion thread here:http://arduino.cc/forum/index.php/topic,122138.0.html
This thread will highlight the best parts of that thread as well as serve as an ongoing discussion thread for the specific driver.
:* :* Thanks to Hexadec for the original efforts. :* :*
Hexadec -> http://arduino.cc/forum/index.php?action=profile;u=142996
Original code: AS1130_Frames_demo.rar attachment
^Corresponding Video^ AS1130 in Movie Mode - YouTube
Commented code: AS1130_Frames_demo_diamonds.rar attachment
Picture mode and PWM sets: AS1130_Frames_demo_Xmas_Tree.rar attachment
^Corresponding Video^ AS1130 in Picture mode using PWM sets. - YouTube
Some other video: AS1130 Demo - Changing 1 bit in Frametime Register - YouTube
PWM Demo: AS1130_Frames_demo_PWM_29102012.rar attachment
^Corresponding Video^ AS1130 Crossplexing Demo 4 - 6 Frames and 6 PWM sets - YouTube
Things to note:
-This is not an IC for beginners, you must know I2C and you must know how to set up an IC without a library, as there is no supported library for it at this point.
-Please refrain from asking questions regarding I2C here, do it elsewhere.
-Please read the datasheet thoroughly. Many questions are answered there.
-Please listen to the advice, if somebody tells you to read the datasheet again, read the datasheet again! We aren't here to babysit you, we are here to help you answer questions related to the AS1130 and using the arduino to run it. If you don't follow this one, don't be surprised if somebody gives up on you.
If anybody would like to create a library, please contact either me or Hexadec
Questions:
what did you do with the SYNC and IRQ pins? Did you pull them to logic low?
IRQ should be pulled high but the sync is left floating. If you check out the datasheet (page 28 Table 25) it shows that you have to physically set the sync_out or sync_in bits to get any response on pin 12.
In other words it's not a problem pulling it to VSS
Do you just pull in frame data or how to you do the memory management? Do you pull in the first frame, pull in the second, delete the first and pull in the third and so on
Here's an example of dynamic data change using the internal EEPROM of a PIC18F4550 (256 bytes).
This gives a negative image of each frame.
I've included the reset routine as well. This is easily ported to Arduino code./***** Flip every bit in eeprom then write to AS1130 **************************/
void flipData(void)
{
printf(usb_cdc_putc, "Flipping Data:\r\n");
char i,j;
char data = 0;
char mask = 0b00000111;
char flipped;
for (i = 0; i <= 253; i+=2) //size of eeprom
{
flipped = mask ^ read_eeprom(i);
write_eeprom(i, flipped);
}
i = 254;
flipped = mask ^ read_eeprom(i);
write_eeprom(i, flipped);
mask = 0b11111111;
for (i=1; i <=253; i+=2) //size of eeprom
{
flipped = mask ^ read_eeprom(i);
write_eeprom(i, flipped);
}
printf(usb_cdc_putc, "Data Flipped:\r\n");
write_frame_data();
AS1130_reset();
}
/***** AS1130 Copy Frame Data from EEPROM ****************************/
void write_frame_data(void)
{
char i, j, k;
char data = 0;
for (i=FRAME0; i<=FRAME10; i++)
{
for (j=0x00; j<=0x0B; j++) // 0x00 to 0x0b are the Current Segments in each frame (CS0-CS11)
{
as_config(i, 2j+1, read_eeprom(data)); // i = frame address, 2j+1 = CS register address (odd numbers) then second data byte
data++;
as_config(i, 2j, read_eeprom(data)); // i = frame address, 2j = CS register address (even numbers) then first data byte
data++;
}
}
}
/ Restart AS1130 with changed settings ***********************************/
void AS1130_reset(void)
{
bit_clear(SHUTDOWNOPENSHORT_BYTE, 0);
bit_clear(SHUTDOWNOPENSHORT_BYTE, 1);
as_config(CONTROLREGISTER, SHUTDOWNOPENSHORT, SHUTDOWNOPENSHORT_BYTE);
as_config(CONTROLREGISTER, MOVIEMODE, MOVIEMODE_BYTE);
as_config(CONTROLREGISTER, DISPLAYOPTION, DISPLAYOPTION_BYTE);
as_config(CONTROLREGISTER, FRAMETIME, FRAMETIME_BYTE);
as_config(CONTROLREGISTER, PICTURE, PICTURE_BYTE);
as_config(CONTROLREGISTER, MOVIE, MOVIE_BYTE);
bit_set(SHUTDOWNOPENSHORT_BYTE, 0);
bit_set(SHUTDOWNOPENSHORT_BYTE, 1);
as_config(CONTROLREGISTER, SHUTDOWNOPENSHORT, SHUTDOWNOPENSHORT_BYTE);
}
OK...here's the video. (Sorry about the crap quality ) http://www.youtube.com/watch?v=msn3LvtdRaM&feature=youtu.be
You look to have four resistors on your AS1130 board. What are those for?
The resistors are:-
1 SDA pull-up
2 SCL pull-up
3 RSTN pull-up
4 IRQ pull-up
That means: I connect every single VDD Pin with 10uF capacitance so that I need 5 x 10uF capacitances for the 5 VDD Pins or do I only need ONE 10uF capacitance and connect that one to ALL the VDD Pins together?
Nooooooo......all the VDD pins are connected internally...you just need ONE 10uF cap for each seperate AS1130.
Could you comment your code a bit with reasons behind the code bits?
I don't quite get why you have frame addresses when you have them defined in a Frames array.There's a few more comments in the code posted in this post: http://arduino.cc/forum/index.php/topic,123071.0.html Anyway,
//12x11 rectangle <---this tells you what the code displays
0b00000111, 0b11111111, //CS0 Frame 0 <---these are the 2 data bytes for Current Segment 0 and this is the start of the first frame's data
0b00000100, 0b00000001, //CS1
0b00000100, 0b00000001, //CS2 The 1's mean an LED is on the 0's off
0b00000100, 0b00000001, //CS3 The data is arranged so that it is graphically meaningful ie. if you look at the frame datas' 1's you can actually see a 12x11 rectangle (on its side)
0b00000100, 0b00000001, //CS4
0b00000100, 0b00000001, //CS5 The data is in binary format and follows the convention that the rightmost bit of the 2 bytes is LED 0 and bit 2 of the first byte is the LED 0A
0b00000100, 0b00000001, //CS6 (see datasheet Table 9 page 15)
0b00000100, 0b00000001, //CS7
0b00000100, 0b00000001, //CS8 The 3 MSB of the first byte tell the AS1130 which PWM set to use (0-7)
0b00000100, 0b00000001, //CS9
0b00000100, 0b00000001, //CS10
0b00000111, 0b11111111, //CS11 <---these are the 2 data bytes for Current Segment 11 and this is the end of the first frame's data
AS1130_Frames_demo.rar (3.51 KB)
AS1130_Frames_demo_diamonds.rar (5.01 KB)
AS1130_Frames_demo_Xmas_Tree.rar (3.76 KB)
AS1130_Frames_demo_PWM_29102012.rar (6.28 KB)