Pages: 1 [2] 3 4 ... 12   Go Down
Author Topic: AS1130 First attempt - working  (Read 21172 times)
0 Members and 1 Guest are viewing this topic.
Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh wow, thats not a bad idea.  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?
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

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);  
 }


I'll upload a video of this later so you can see the speed etc.
« Last Edit: September 25, 2012, 12:37:59 am 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

OK...here's the video. (Sorry about the crap quality  smiley-red)


http://www.youtube.com/watch?v=msn3LvtdRaM&feature=youtu.be
Logged

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

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

Its a nice video.
I do have a question . You look to have four resistors on your AS1130 board.  Are two of those the I2C pull-up resistors?  What are the other 2 for?
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

The resistors are:-
1 SDA pull-up
2 SCL pull-up
3 RSTN pull-up
4 IRQ pull-up


As per the datasheet.  smiley-wink
Logged

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

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

Oh, I was unaware you needed a pull up on each of them.
I'm going to be quite honest, I've never used interrupts.  Did you find yourself using them often in making sketches?
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

If you don't use pullups on those pins they'll be like the Grand Old Duke of York...they won't know whether they're up or down  smiley-mr-green

I use interrupts whenever I need them.

For instance (if I could get the IRQ line to respond  smiley-eek) I would play through 36 frames of data, then have the interrupt fire, then change the data and restart the movie with new frames.

I'm doing this at the moment but I have no control over when the change happens - if I used interrupts I would be in charge... smiley-twist
« Last Edit: September 25, 2012, 09:39:35 am 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

Fire away mate.... 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

To be honest mate...I think private messages are for 'private' communications.

If questions are answered on the Forum, then everybody benefits and mostly you get more than one answer which also benefits everybody. Also the recipient of a private message ends up answering the same questions over and over again.

Anyway...the bottom line is I don't answer private messages unless they are errrrr private... smiley-mr-green


To contradict the above... smiley-twist

I don't have a schematic for the board other than what is posted in this thread. The LEDs are wired exactly as shown in the datasheet and so is the AS1130. There is also quite a bit of example code posted in this thread.

The code for the video you refer to is written for the PIC18F4550 because I am more familiar with PICs and I have lots of them. I will port it to Arduino when I get the time but it's not a priority. Also I have hung on a 64K EEPROM which gives me room for 77 full pages of 36 frames.

I will be glad to answer any specific questions you have on the Forum and I suggest that you dive in and build yourself a panel, get the AS1130 and Arduino fired up and then see what problems you have.

« Last Edit: October 10, 2012, 02:28:02 pm by Hexadec » Logged

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

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

The AS1130 will work fine with the ATmega128.  The only hurdle I see really is that I'm not sure if the Arduinos Wire library will work with it.  I don't see any reason why it wouldn't but at the same reason I don't know if it would, i'm not an expert on libraries.  The only thing that would really "kill" the 128 chip in terms of compatability is if it had TWI (I2C) or not, and it does, so you are golden there.  The 128 also has the same operating speed as an ATmega328P like on the popular arduino boards.  The thing is that the PIC18F4550 has a max clock speed of 48MHz, so it may run a little slower than the video(if there is one, i'm sick so I don't feel like looking) but it should still do fine.

I'm actually incorporating this chip into one of my projects and I plan on using an ATtiny85 clocked at 10MHz to run it, I think it'll do fine. Only 2 ways to find out and I don't wanna pull up the datasheet! (Lazy! cause i'm sick (that excuse works wonders))

Regarding the programming language, the microcontrollers are generally written in C code and then uploaded via an ICSP or some other type of programmer.

Regarding the frames, hexadec will have to answer that one.
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

Hope you feel better soon funky mate.... smiley-roll-sweat

Anyway....

The AS1130 runs completely independently once the microcontroller has told it what to do.

Basically, you set up the registers, upload the frame and PWM data and tell it to start...it then runs on it's own.

While it is running you can upload more data and it'll display that.

All this is explained in the first post of this thread along with the answer to all your other questions.... smiley-wink
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

Read the sketch posted in the first post....and here http://arduino.cc/forum/index.php?topic=123071.0


BTW the speed of the processor is irrelevant it is only used as a master on the serial bus to send commands and data.
« Last Edit: October 11, 2012, 04:26:25 am 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

Quote
I don't really understand every english expression

I'm not being rude but I think the basic problem is that this is not a chip to be playing with if you are a complete beginner.
If you need to ask questions like the ones you have asked (both in the PMs and in the Forum) then you need to start at a more basic level.

Questions like "what if I don't use an eeprom?" and "what language is used?" tell me that either:

a) you are a complete beginner
or
b) you can't be bothered reading the sample code or the data sheet.

I suggested to you that you build the system and use the supplied code to get the thing working....THEN ask questions about any problems you have (which I will be pleased to answer) or if you are really a beginner then try some simple matrix led experiments to give you a better understanding.

It took me many hours reading the datasheet of this chip to finally get a good understanding of it's functions...but I have a long background both in software and hardware and started off from a position of 'knowing' how to manipulate registers, write code etc.  smiley-wink (also the English in the datasheet is not very accurate in some places!)


I'm not trying to put you off but just think that you are trying to run before you can walk (as we say in English  smiley-mr-green)
« Last Edit: October 11, 2012, 05:29:02 am by Hexadec » Logged

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

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

You will need a breakout board to be able to use the AS1130 if you don't already have a board.  The chip doesn't come in a DIP package, it comes in a SSOP-28 package so you won't be able to stick it in a breadboard when you get it.
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

ALL your questions HAVE been answered you are just not understanding/listening/making any effort.

I see little point in continuing with this until you have a specific question about something you don't understand in the datasheet.
Logged

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

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