AS1130 First attempt - working

hello guys, hope you still know me

How could we forget you... :stuck_out_tongue:

Hello mate. :grin:

Simple maths is what you need...for 36 frames you need 2 bytes for each current segment so :

per frame:


12 current segments
2 bytes each 12*2 = 24


36 frames 36*24 = 864


PLUS you may need 1 PWM set
1 byte for each LED = 132

Bytes needed for each frame set = 864+132 = 996

For 3 devices 3*996 = 2988

therefore you need less than 3KB for each 36 frame set.

binarygod:
three AS1130's i'm going to use to show a moving font on the 11x396 screen.

Hold up! you can't do an 11x396 matrix using 3 as1130's . Each 1130 can drive 132 leds MAX. your 11x396 would need 33 1130's to drive that kind of matrix buddy.

To (almost) quote the great Bob Dylan...

"the answer my friend is blowing in the datasheet"

Have a good read. :grin:

...and...I even gave you a link to an explanation of multiplexing...read THAT as well.

Now I don't mind answering questions for someone who makes the effort and has the abilities required for the task, but actually THINKING for someone, then answering the questions, then answering the same questions again is really starting to make me lose the will to live........

Please binary, just read the datasheet, look at the cross-plexing diagram and then think about how digital electronics works

The datasheet is not as bad as some...but it IS hard to understand because it assumes quite a high level of knowledge and understanding from the reader. (quite rightly :grin:)

If you read up on how a screen/frame/matrix of LEDs is scanned...all will become clear. :wink:

Are you just trying to wind me up?

Read how I2C works (hint 7 or 8 bit addresses).

OR

A better idea...YOU use address 0x60 in YOUR code and then you'll KNOW why mine is as it is.

This is the last time I'm going to do your thinking/research! :wink:

Read this:

Specifically:

Note

There are both 7- and 8-bit versions of I2C addresses. 
7 bits identify the device, and the eighth bit determines if it's being written to or read from. 
The Wire library uses 7 bit addresses throughout. 
If you have a datasheet or sample code that uses 8 bit address, you'll want to drop the low bit (i.e. shift the value one bit to the right), yielding an address between 0 and 127.

I've already got some code that may be useful to you. I wrote it for the CCS C compiler.

What chip are you going to use and which compiler?

Oh well...I'm not familiar with either.

C is C though... :grin:

The program is pretty much C if you take out the Arduino Library stuff ie. wire.write() is i2c_write() or i2cWrite() in many C compiler libraries.

BTW I would use and adapt the LAST set of code I posted... :wink:

yeah..it has better comments and is laid out better. also uses PWM (if you need it)

I have also put some subroutines at the end that you may find useful. :grin:

@Funky

I've bitten the bullet...after seeing 500 LEDs for $14 inc shipping I've ordered 2 x 4" x 10" stripboards and I going for it... ]:smiley:

I can join the stripboards to make 8" x 10" which is big enough for a 24 x 22 matrix of LEDs (528) plus the AS1130s.

Wish me luck with all that soldering..... =(

Awwww yeaaaa.
Dude, you have as much luck as I can give, but i'm not a leprechaun so it may not make a difference.

Lemme know how it goes. I really want to make a rain animation using these ICs and all that as my end goal

More good news... :grin: :grin:

I've finally had the time to hook up a logic analyser to the AS1130 and it seems that I have a problem when using the wire library to read the registers...I haven't yet figured out what it is...but over reading all the registers around the Interrupt Status Register actually gets to read it AND clear the interrupt bit....Yeeeeeeaaawwwww!

This is the final problem with this chip.... XD

Will keep you updated.

So there may be an unknown internal connect?

Part of the idea of having defines is that it makes it easy to adapt code....so for each extra chip you just need to change the default address to the address set on the chip and change the datasets and it should work out of the box.

(not that I know what you intend to do! :grin:)

If you read the notes in the example code (AND the datasheet)...the picture register setting is overidden by the movie reg. setting so unless you are using pictures it doesn't need to be there...

...however it IS there to show how it can be used.

Yo binarygod. Not that I don't like questions but you do know that you can start programming and if its wrong, you can change it. We've already discussed the hardware portion of the AS1130 and that's the part you can't change.

Programming on your own may answer some of these question.

funkyguy4000:
So there may be an unknown internal connect?

I don't know what's going on yet...not had much time to play but I found that if I read 20 bytes starting at 0x00 (picture reg.) it frees the IRQ pin which should clear with a read of 0x0E (it doesn't)

There's something dodgy going on with the way I'm reading the bus using wire...but it works fine for the first 15 bytes...f*!k knows what's going on but the good news is at least I now know that the IRQ works OK to some extent which frees up continuing with four screens.

I must say though that I may just use the MCU to control the whole lot and ignore the chip interrupts. It should be easy enough to get everything synchronised. (I hope :D)

Well like I said...it is C code but unfortunately I'm not familiar with your compiler...if it's ANSI C you shouldn't have too much trouble.

How well do you understand the registers in your processor?

It's fairly easy to write routines to implement I2C in C but I'm sure your compiler will have routines for this. :wink:

EDIT:

I'm going to make a suggestion which you may or may not like....

Why don't you buy yourself an Arduino board, then you'll have 1000's of expert programmers there to help not only with the hardware side but the C programming as well.
I bought a genuine UNO for £16 on eBay but I'm sure there are cheaper versions (not that I'd recommend a Chinese rip off) or it's very easy to build one yourself. You can even buy the chips with the bootloader installed. :wink:

Here we are...free cable and free postage.
http://www.ebay.co.uk/itm/Arduino-UNO-R3-V3-0-ATMEGA328-FREE-USB-CABLE-Dev-Module-Ideal-4-Robotics-Rev-3-/321017689679?pt=UK_Computing_Other_Computing_Networking&hash=item4abe25364f

Well...I wish you good luck with that!

As this is the Arduino Forum I doubt you'll get much help with porting code.
If it was from another compiler to the Arduino platform you would get loads of help.
I have shown you some of the things that you can do with the AS1130 and will continue to write code for it until I get fed up or move on to another interesting project but you can't expect me or anyone else to try to help you with coding using a compiler/language/chip that has nothing to do with the Arduino. (not on this Forum anyway)

If I were you, I'd get an Arduino....problem solved.

Otherwise, I don't see that you can progress much further in this Forum and I'm not aware of any help forums for your compiler.