Pages: 1 ... 3 4 [5] 6 7 ... 12   Go Down
Author Topic: AS1130 First attempt - working  (Read 18044 times)
0 Members and 1 Guest are viewing this topic.
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

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  
« Last Edit: October 21, 2012, 12:53:17 pm by Hexadec » Logged

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

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

Ohhh so you aren't fabricating your own custom boards at like a professional circuit board quality?
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

Noooo...much to expensive and it's more fun to get something working from a pile of old junk.  smiley-mr-green
Logged

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

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

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

Accelerate to 88 miles per hour.

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

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:

Code:
    //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.
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

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.
« Last Edit: October 23, 2012, 04:18:15 am by Hexadec » Logged

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

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

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

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

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

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

Alright.

I'll continually update this thread with any progress I make
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

Great stuff!
Logged

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

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

Interesting.

In your code, it shows #define DOTCORRECTION 0x80
although in the datasheet it says
Quote
The Dot Correction Register is selected via data 128 on addr 253
the 0x80 is the data 128, but where is the address 253?
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

Page 14 Table 7

0xFD  smiley-razz
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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... smiley-wink
Logged

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

I'm pleased to have helped.  smiley

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

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

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

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
Logged

Accelerate to 88 miles per hour.

Pages: 1 ... 3 4 [5] 6 7 ... 12   Go Up
Jump to: