AS1130 First attempt - working

wait wait wait wait, you have access to all that? How much does that cost you?
(I've been looking for a cheaper way of fabrication but b/c I'm a student, I can't do much)

It won't be costing me much (I hope) I've just bought a load of ultrabright red LEDs from ebay at just under $3 US per 100 so that's less than $16 then I'll use stripboard to mount them which I already have (bought from a charity shop for peanuts ]:smiley: ) The chips are donated by AMS, Microchip and Atmel and the adapter boards for the AS1130s are about $5 for 10 from China.

It's the large amount of soldering that puts me off... :grin:

Ohhh so you aren't fabricating your own custom boards at like a professional circuit board quality?

Noooo...much to expensive and it's more fun to get something working from a pile of old junk. :grin:

True, it is super expensive.
I currently pay US $5 for a square inch for a 2 layer board

Okay another question, more like a favor.

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.
I don't understand this:

    //12x11 rectangle 
  0b00000111, 0b11111111,    //CS0  Frame 0
  0b00000100, 0b00000001,    //CS1
  0b00000100, 0b00000001,    //CS2
  0b00000100, 0b00000001,    //CS3
  0b00000100, 0b00000001,    //CS4
  0b00000100, 0b00000001,    //CS5
  0b00000100, 0b00000001,    //CS6
  0b00000100, 0b00000001,    //CS7
  0b00000100, 0b00000001,    //CS8
  0b00000100, 0b00000001,    //CS9
  0b00000100, 0b00000001,    //CS10
  0b00000111, 0b11111111,    //CS11

And I also don't get why it seems like you do all your animations in the setup() method rather than the loop() method.

There's a few more comments in the code posted in this post: http://arduino.cc/forum/index.php/topic,123071.0.html

If I understand your question correctly (!?*) The code I posted is not supposed to show how do do tight efficient programming, it's laid out in what I hope is a logical and understandable way to show, step by step, how to get some action on a screen of LEDs using the AS1130.

Having said that, when I do the defines etc. I always have in mind how I intend to develop the code in the future.
Hard coding bits and settings in a programme is bad practice unless it is never going to change, but using variables defined elsewhere also adds some confusion to someone trying to learn how the process works.

Also...there is no way I would normally handle such a large amount of data as shown in the example. In my ongoing experiments with this chip (which have been with a USB enabled PIC18F4550 and a C# application on the PC) there is no data defined in the code, it is uploaded from a file and then fed to the AS1130 by the MCU. I have written the MCU code to respond to ascii characters sent over the USB from any source eg. the MCU receives 's' and then reads the status register of the AS1130 and sends it back to the terminal program on the PC... or it receives a 'u' which tells the AS1130 to go faster.

Here's the main loop:

 	while (TRUE)
	{
		usb_task();
		if(usb_cdc_kbhit())
		 {
			inByte = toupper(usb_cdc_getc());

			if(inByte == 'A')	{AS1130_decrease_brightness();}
			if(inByte == 'B')	{AS1130_increase_brightness();}
			if(inByte == 'D')	{AS1130_speedDown();}
			if(inByte == 'F')	{AS1130_fadeToggle();}
			if(inByte == 'L')	{AS1130_Scroll_left();}
			if(inByte == 'M')	{AS1130_scrollToggle();}
			if(inByte == 'N')	{flipData();}
			if(inByte == 'P')	{AS1130_Next_page();}
			if(inByte == 'Q')	{AS1130_Prev_page();}
			if(inByte == 'R')	{AS1130_Scroll_right();}
			if(inByte == 'S')	{AS1130_status();}
			if(inByte == 'U')	{AS1130_speedUp();}
			if(inByte == 'Y')	{write_new_EEPROM_Data();}
		 }
	}

I am also sending the commands using a TV remote control...but THAT'S another story :grin:

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

The reason that everything is done in the setup is that it reads more sequencially and also to fire up the AS1130 initially it needs some data and all it's commands.
You need to think of the AS1130 as a seperate entity that does as it's told and the MCU as the boss chip that gives the orders.

Once the AS1130 has it's orders, it gets on with it with no more intervention from the MCU.

So... the main loop is where the programmer decides what to do next and the setup has already issued the correct instructions and data to get the ball rolling.

In short, the example programme is to give you ideas and inspiration (I hope) but is not a programming tutorial...that bit is up to the user... 8)

Hope that's a bit clearer now mate.

Sorry I forgot to mention i'd figured it out this morning.
I understand that. I would like to do things with PWM. If you figure any of that out, maybe we can write a library together or somethin

:grin: :grin:

I think I'll leave the library writing to you...I've got too many projects I want to get on with. (I'm programming a RTCC with an MCP79512 and a PIC18F26K20 at the moment)

Alright.

I'll continually update this thread with any progress I make

Great stuff!

Interesting.

In your code, it shows #define DOTCORRECTION 0x80
although in the datasheet it says

The Dot Correction Register is selected via data 128 on addr 253

the 0x80 is the data 128, but where is the address 253?

Page 14 Table 7

0xFD :stuck_out_tongue:

thanks to Hexadec for his/her clarifying comments.... I couldn´t figure out that all VDD and GND pins were internally connected.... and that saved me a lot of routing work... :wink:

I'm pleased to have helped. :slight_smile:

I'm a he...(hee hee) so thank-you Sir or Madam... ]:smiley:

Oh wow, they created an account just to post that comment.
I haven't made any progress with actually testing it because both my soldering irons blew up basically

new account created not only to thank Hexadec but to keep on posting.... on my first go i will cascade two 1130s to run 216 single LEDs, together with a AS1108 to run a "home-made" 4-digit 7-digit LED display and a EEPROM.... i will post as soon as i get some results... for good or bad... :wink:

on my first go i will cascade two 1130s to run 216 single LEDs

That sounds like fun... :grin: I'm trying to motivate myself to make up 4 boards (528 LEDs) but all that soldering really puts me off!

How are you going to arrange the 216 LEDs? I can't for the life of me see how you can do it unless you intend to switch off some Current Segments but even then you end up with the wrong number of LEDs.

I've got 3 AS1108s as well but haven't got round to 'evaluating' them yet.

It'll be great to see your results. :wink:

Oh wow, they created an account just to post that comment.

Yeah...I KNEW there were people out there with good manners... :grin: :grin: :grin:

hahaha.... you bet it is going to be great fun.... I never programmed a PIC before, but shouldn't be so difficult.. :slight_smile:

already tried to activate this amount of LEDs using shift registers, but blinking was unacceptable....though it worked fine

so now i am cascading AS1130s as shown in datasheet page 1 and connect them to a Freescale MS9S08JM16 (sorry Arduino folks, next time).... and will use all of the current segments, but not all LEDs.... i will balance each segment so i have similar number of LEDs on each of them.....

hope it works!!!.... i am not willing to show characters but will use LED configuration as shown in FIG.26 page 31, dropping out some LEDs

will upload schematics as soon as i finish off some connections doubts regarding EEPROM

Wow I really wish I had my own place. I would love to solder all those leds although I can't do it in my building. Silly apartments.
If anybody does anything with PWM for the AS1130, lemme know! I'm still trying to figure it out when I'm not studying or chillen with the girl.