Pages: [1] 2 3 ... 8   Go Down
Author Topic: AS1130 Ongoing Discussion 132 Individually controllable, PWM LED driver  (Read 10938 times)
0 Members and 1 Guest are viewing this topic.
Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

 smiley-kiss smiley-kiss Thanks to Hexadec for the original efforts.  smiley-kiss smiley-kiss
Hexadec -> http://arduino.cc/forum/index.php?action=profile;u=142996

Original code: AS1130_Frames_demo.rar attachment 
^Corresponding Video^ https://www.youtube.com/watch?feature=player_embedded&v=qQ3lE_iK7_s

Commented code: AS1130_Frames_demo_diamonds.rar attachment

Picture mode and PWM sets: AS1130_Frames_demo_Xmas_Tree.rar attachment
^Corresponding Video^ https://www.youtube.com/watch?feature=player_embedded&v=yx3FU0CgyPw

Some other video: https://www.youtube.com/watch?feature=player_embedded&v=8BXjyxig61k

PWM Demo: AS1130_Frames_demo_PWM_29102012.rar attachment
^Corresponding Video^ http://www.youtube.com/watch?v=2LYZrHvw264&feature=youtu.be

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:

Quote
Quote
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

Quote
Quote
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.
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, 2*j+1, read_eeprom(data));    // i = frame address, 2*j+1 = CS register address (odd numbers) then second data byte
      data++;
      as_config(i, 2*j,   read_eeprom(data));    // i = frame address, 2*j = 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


Quote
Quote
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

Quote
Quote
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.


Quote
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.
Quote
There's a few more comments in the code posted in this post: http://arduino.cc/forum/index.php/topic,123071.0.html  Anyway,
Code:
//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 - downloaded 36 times.)
* AS1130_Frames_demo_diamonds.rar (5.01 KB - downloaded 26 times.)
* AS1130_Frames_demo_Xmas_Tree.rar (3.76 KB - downloaded 20 times.)
* AS1130_Frames_demo_PWM_29102012.rar (6.28 KB - downloaded 34 times.)
Logged

Accelerate to 88 miles per hour.

Southport UK
Offline Offline
Full Member
***
Karma: 1
Posts: 195
Been at it a long time...still learning every day.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for doing this funkyguy old chap.

It's nice to clear out the cobwebs and have a fresh start.  smiley-mr-green

I am working on a library for the AS1130 which I will post at sometime but I've become a little distracted with writing code to convert video files to matrix LED data to use on my 24 x 22 screen.

I have soldered all the LEDs and connected them...I just need to connect up the other 2 AS1130s and hopefully we'll have a working 4 chip system to analyse.

I have ported my PIC code to the Arduino but have had to change the way the data is written to the chip. It's now faster but there are still issues with the Wire library that I don't encounter by bit banging on the PIC and which I still don't understand (but I'm getting there).

I've spent quite a long time looking at the data stream with a logic analyser...so I know what the problems are...I just need to find what's causing them.  smiley-eek

Obviously these issues need addressing before I can release a library.

Also I'm writing the class code to be fully OOP compliant and not just a usable bit of code.

Anyway I'm hoping to post a movie running on the 24 x 22 screen by next week showing a hand waving in full 256 level greyscale.
Logged

Sponge.
I'm allowed to have it 'cos it's not sharp.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Aw that sounds awesome!!
I'd forgotten you are more familiar with the pic over the arduino, good luck man!
Logged

Accelerate to 88 miles per hour.

Southport UK
Offline Offline
Full Member
***
Karma: 1
Posts: 195
Been at it a long time...still learning every day.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well here it is at last.... smiley-mr-green

I've found it really difficult to film this with my iphone, but you get the idea I hope.

The LEDs are covered with a sheet of inkjet paper to try to difuse the light a bit.
The vids are full 8 bit PWM and are converted from animated gifs.

http://youtu.be/zMzKhonWhq0

Second one is further away...hope it makes some sense.  smiley-lol

http://youtu.be/sViovjihxvg

They look better in real life...honest guv.... smiley-razz
« Last Edit: December 15, 2012, 03:18:07 pm by Hexadec » Logged

Sponge.
I'm allowed to have it 'cos it's not sharp.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh nice!
Is are those each still just the 6 frames of PWM?

What I'm hoping to do is create some sort of dynamic animations.  Created on the arduino due to certain set params and then uploaded to the AS1130 on the fly.
Logged

Accelerate to 88 miles per hour.

Southport UK
Offline Offline
Full Member
***
Karma: 1
Posts: 195
Been at it a long time...still learning every day.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah...pretty much the same code as before but for 4 chips and with the first chip as master sync, the other 3 as slaves...I didn't blank the changeover to the next six frames to show how fast it is.

So...frame data is just 6 frames all LEDs on...and 6 sets of PWM data for each animation.  smiley-cool

I've written a program which takes 6 frames of an animated gif and converts them to the data required for the 24x22 screen...I separate the frames in photoshop first then feed them to the C++ prog, then copy and paste to the MCU datafile.

I'm interested in what you want to do with this project as well...perhaps we can come up with something together....
Logged

Sponge.
I'm allowed to have it 'cos it's not sharp.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

We will, I just need to fiddle this winter break.  I have so much to do though, so it might be here and there.  I need to reinvent something and then make an entire website and program as well as work at the bakery.

Logged

Accelerate to 88 miles per hour.

Southport UK
Offline Offline
Full Member
***
Karma: 1
Posts: 195
Been at it a long time...still learning every day.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No pressure...after all this is a hobby.  smiley-mr-green

I've got a few things to do myself but will continue with this project. I'd like to find some RGB LEDs that I can solder in a tight, even matrix then run with AS1130s...this chip would be perfect for colour mixing and I have ideas for full motion video if I can bulid a suitable screen.
Logged

Sponge.
I'm allowed to have it 'cos it's not sharp.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

True,

If you get the itch to use SMD RGB 5050 LEDs, I found a vendor in china on eBay who sells them at really cheap (100 for $8).  Those are pretty small so they can go into tight spaces
Logged

Accelerate to 88 miles per hour.

Southport UK
Offline Offline
Full Member
***
Karma: 1
Posts: 195
Been at it a long time...still learning every day.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It'd be good if you could let me have the details...only problem is that I would have to have a board made for them and hand soldering 528 5050 LEDs does not fill me with joy... smiley-mr-green smiley-mr-green

Do you have a good manufacturer who would produce the board with the LEDs already soldered? Maybe we could look at that option...
Logged

Sponge.
I'm allowed to have it 'cos it's not sharp.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been looking at getting copper glads and then making my own 5050 SMD RGB Led boards.  They'd be small enough that I could use my own reflow oven (which i'm going to make once these infernal finals are over) and they'd do what I need.  I'll post pics when I make em.  Eventually i'll make boards with the 5050 footprint as well as 2 1206 footprints for a cool white LED and a B.L. Led.

http://www.ebay.com/itm/170786097936?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1438.l2649

http://www.ebay.com/itm/300757213438?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1438.l2649

I should be able to make about 60 of the boards from a single 9x12 copper clad.  Just need the chems.
Logged

Accelerate to 88 miles per hour.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Binary, do you have an AS1130 mounted and going?
Logged

Accelerate to 88 miles per hour.

Southport UK
Offline Offline
Full Member
***
Karma: 1
Posts: 195
Been at it a long time...still learning every day.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Merry Christmas all.  smiley-mr-green
Logged

Sponge.
I'm allowed to have it 'cos it's not sharp.

Southport UK
Offline Offline
Full Member
***
Karma: 1
Posts: 195
Been at it a long time...still learning every day.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just a quick update...I've now got the I2C bus running at 1Mhz and it's very stable. I spent a couple of hours today with the 'scope on the SCL pin and by experiment with the resistor values I've now got a very fast rise time on the clock pulses and it's almost a clean square wave. The bus capacitance on these chips is quite high individually and this was causing the problem. I originally used 4K7 resistors and they worked fine @100Khz and not bad at 400Khz...then while playing with changing almost a 1KB of data after a frame interrupt I found that there was a definite visible lag on changeover... smiley-mad I then upped the bus speed in increments of 100KHz until the reliability dropped dramatically.

Anyway...the time between the interrupt firing at the end frame and the start of the new frame PWM set is now very slightly over 217mS which I'm more than happy with. I've ordered some free sample 128KB, 1 MHz I2C EEPROMs from my lovely Microchip (  smiley-mr-green ) today so we'll see how fast it runs when pulling data from the external EEPROM...the sky should then be the limit for long animations with full 8 bit PWM... smiley-wink

@Binary
Quote
If you do a software reset and set the shdn-bit to 0, are all controll registers resetted then (set to default
values) ? because thats not written in the datasheet.

We have a saying in English Pantomime....

"OH Yes it is...."  smiley-razz

To save you looking (as it's your Christmas present).

If you reset 'shdn' the internal state machine stops and all outputs are turned off.
If you set 'shdn' the internal state machine starts and all outputs are turned on.

So you DON'T lose the register values.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you reset the 'init bit' then the state machine resets and you DO lose the register values.

Just like it says in the datasheet.
Happy New year mate.  smiley-mr-green

« Last Edit: December 28, 2012, 03:35:12 pm by Hexadec » Logged

Sponge.
I'm allowed to have it 'cos it's not sharp.

Southport UK
Offline Offline
Full Member
***
Karma: 1
Posts: 195
Been at it a long time...still learning every day.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oops...forgot to mention...

The CS register is limiting at 15mA and the whole 528 LEDs, four AS1130 chips, 1 512Kb EEPROM and an 18F2550 running at 48 MHz are all powered by the USB....  smiley-cool


Here's the usual crappy video...with and without 1 sheet of inkjet paper masking the LEDs.


http://youtu.be/Agxh7WkdDQs


You can at least see how fast the changeover takes place.  smiley-mr-green
« Last Edit: December 28, 2012, 04:02:27 pm by Hexadec » Logged

Sponge.
I'm allowed to have it 'cos it's not sharp.

Pages: [1] 2 3 ... 8   Go Up
Jump to: