AS1130 First attempt - working

Aw crap, I pulled SYNC to ground on the boards. I guess I can just cut the trace.

I guess I can just cut the trace.

Unless you're using multiple chips I wouldn't bother...I pulled it low and high on different prototypes and it made no difference.

I haven't tried cascading them yet though.

Keep me informed of how you get on. :wink:

Oh thank goodness. The trace is super close to another one and I don't wanna mess it up.
Will do!

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 8)

I've been working on this chip through an 18F4550 PIC for the last few days and have just added a 512Kbit EEPROM to swap out the frame data. The EEPROM holds 38 full datasets and you can flip the data on the fly.

Great fun this ain't it.... :grin:

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?

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

OK...here's the video. (Sorry about the crap quality :blush:)

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?

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

As per the datasheet. :wink:

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?

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 :grin:

I use interrupts whenever I need them.

For instance (if I could get the IRQ line to respond :astonished:) 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:

Fire away mate.... :grin:

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... :grin:

To contradict the above... ]:smiley:

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.

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.

Hope you feel better soon funky mate.... :cold_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.... :wink:

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.

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. :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 :grin:)

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.

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.

He's kinda right. What exactly do you not quite get yet, so we can help you out?