Show Posts
Pages: 1 ... 8 9 [10] 11 12 13
136  Using Arduino / LEDs and Multiplexing / Re: AS1130 So far, so good... on: October 25, 2012, 05:20:15 am
It most certainly is...or at least a 'flavour' called crossplexing by ASM
137  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 23, 2012, 03:10:25 pm
Page 14 Table 7

0xFD  smiley-razz
138  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 23, 2012, 12:55:04 pm
Great stuff!
139  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 23, 2012, 12:11:18 pm
 smiley-mr-green smiley-mr-green

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)
140  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 23, 2012, 04:13:50 am
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:
Code:
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  smiley-mr-green

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



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... smiley-cool


Hope that's a bit clearer now mate.
141  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 22, 2012, 03:35:18 am
Noooo...much to expensive and it's more fun to get something working from a pile of old junk.  smiley-mr-green
142  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 21, 2012, 12:50:57 pm
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-twist ) 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... smiley-mr-green  
143  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 21, 2012, 12:35:24 pm
Yeah...the whole datasheet is a bit difficult...there is no overview and the typical application diagrams are next to useless.

Oh well...at least it's been written by someone with a reasonably good command of English and it's not translated by Google from the original Thai dialect... smiley-mr-green smiley-mr-green

As soon as I get some time I'll be building a big board with 4 panels so the fun will REALLY start then.  smiley-sweat
144  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 21, 2012, 12:10:54 am
mornin' funky  smiley-mr-green(well it is here anyway)

As you know, for some reason I haven't yet discovered, I can't get any response on the IRQ line so I haven't done anything yet with multiple screens.

That said, you have several options for generating interrupts.

If, for instance, you want to scroll across 2 LED matrices I would think that you would set the first AS1130 (the one that generates the sync clock) to interrupt after the last frame. Then the controlling processor tells the next AS1130 to start scrolling. When it has displayed its last frame it sends an IRQ and the cycle repeats.

As for the programmable clock out freq., it's fairly clear that the sync frequency can be altered to 1 of 4 speeds but I have no idea if this changes the frequency of the internal clock of the 'master' chip as well as the sync out line. I'll do some research when I get a bit of free time.  smiley
145  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 20, 2012, 11:03:41 pm
Quote
Okay as I understand the PWM is responsible for the brightness (if they shine bright or dark) and because of that the leds need more or less current.And if I want now to know the current of every single led then I use that formula on the page 33 'LED Current Calculation' ?
But if I only use that formula...then the fact that the other chips also need current is ignored?  cause you told this: "Then you must add some for the chips themselves plus leakage, losses, blah blah blah...."

Read the datasheets.  smiley-roll-blue

Quote
How can I be sure that the current of the LEDs is never too high that they burn? If I set the Current Source register the same value as the IMAX of the led?

Ohms Law...and why ask me to answer a question I have already answered in full?

Quote
I found some 10mA leds like these: (I want to use square leds, they look much cooler smiley-wink): http://www.eled.com/category.asp?catalog_name=leds&category_name=single+color+-+square+led&page=1
There is written IF=10mA, but if you open the datasheet there is written 20mA! So are those leds now 10mA or 20mA for IF?Could I use them?

Do you want me to email the supplier for you and ask them if their description or the datasheet is correct? smiley-roll-blue
146  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 20, 2012, 10:17:01 am
Like I said earlier...read the datasheet, use Ohms law and believe the datasheet (usually)  smiley-mr-green
147  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 17, 2012, 11:31:40 am
Quote
I'm really sorry that I'm still discussing with you
I don't have a problem with that...as long as you are prepared to put in the effort to understand.... smiley-mr-green

Quote
What do you mean with '1 Current Source'?
There are 12 Current Sources CS0 - CS11.

Try to forget about crossplexing and charlieplexing for a moment and think about how a matrix of LEDs is scanned.
Here is a good explanation of how it works: http://www.franksworkshop.com.au/Electronics/RGB/RGB.htm

This means that it is only possible for there to be 11 LEDs on at any one time. (in this case)
Then... we take into account that each LED is also PWM driven (you can look that one up yourself  smiley-razz)

Quote
But in your first programm the current source register is 0xFF so 30mA per Led, and then you have 330mA and not 235?

The current source register is not setting the amount of current drawn by each LED it is setting the maximum possible current that CAN be drawn (allowing dimming of the display)
The amount of current drawn is determined by the circuit characteristics but is LIMITED to a MAXIMUM of 30mA by the CS Register.

Quote
But if the Current Source Register is 0xFF then all the LEDs together draw 11x30mA so 330mA and that three times (three screens) so 990mA!
Wrong!

Quote
Isn't there any solution to have max. 500mA for the three screens together?
Yes.
The obvious way is to use LEDs that draw less current....if you can find them.
OR easier
Limit the current in the Current Source Register to 15mA (0x0F) but you'll have to make sure in software that this doesn't change.
148  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 17, 2012, 09:58:01 am
 smiley-mr-green
Quote
when the CURRENTSOURCE Register is 0xFF then every single led gets 30mA, so 132 x 30mA = 3,96mA no?

Ahhh but if you read the datasheet the LEDs are crossplexed and the scanning only turns on 1 Current Source at a time...

My board (as I said) draws 245mA when full on and it draws that for 487.5mS or a MAXIMUM of 500mS (it could be 32.5mS too but THAT would be the minimum time)

Quote
THIS problem with the current is the last thing I have to know to build the circuit finally...

You are right to consider all angles before embarking on a design and building the prototype....but the datasheet gives all this information and you can trust it!
OR
You can trust the fact that I have one working and I have shared the information.

If you consider that 11 x 20mA LEDs  draw 220mA when full on and you have 3 boards then 3 x 220 = 660mA
Then you must add some for the chips themselves plus leakage, losses, blah blah blah....

I would design for a 1.5A supply to drive 3 boards and a MCU etc.



Now it's time to get the soldering iron out.... smiley-razz
149  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 17, 2012, 08:52:48 am
Are you a student by any chance?  smiley-mr-green

Look up Ohms law and read the datasheet.

Read about PWM duty cycles.

 smiley-twist
150  Using Arduino / LEDs and Multiplexing / Re: AS1130 First attempt - working on: October 17, 2012, 06:16:13 am
Don't forget that the LEDs are being fed by a variable duty cycle.

I am using a 3.3V regulator fed from the 5V USB port (like on the Arduino) and the maximum current drawn by the AS1130 when all LEDS are on and at maximum brightness is about 245mA but this is only for a maximum 500mS as it then switches to the next frame.

I would allow 500mA per 11x12 panel..that should be more than enough (unless you have other stuff connected) 
Pages: 1 ... 8 9 [10] 11 12 13