Pages: 1 ... 6 7 [8] 9 10 ... 12   Go Down
Author Topic: AS1130 First attempt - working  (Read 19203 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

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!  smiley-mr-green)


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.
« Last Edit: November 06, 2012, 01:25:14 pm by Hexadec » Logged

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

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

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

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  smiley-grin)
« Last Edit: November 06, 2012, 02:26:03 pm by Hexadec » Logged

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

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

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.  smiley-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.  smiley-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
« Last Edit: November 06, 2012, 03:39:23 pm by Hexadec » Logged

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

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

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

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

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

Update on the IRQ problem:

Still haven't managed to set the address pointer to the correct register using wire but 1 major issue is solved.

The Control register address words are not contiguous...they read from 0x00 to 0x0B skip 2 then start at 0x0E again. so reading 14 bytes does not read all the registers as in my code but only reads as far as the 2 unused registers 0x0C & 0x0D. This means the IRQ status is never read and hence the IRQ pin is never cleared!

Oh well...I'm always telling people to RTF datasheets...... smiley-eek

At least now I can get on with the 24 x 22 matrix when the parts arrive from China.  smiley-mr-green
Logged

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

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

Interesting,  I'll have read the datasheet (again!) to understand.

How long do you think it'll take for them to arrive?
Usually takes about 25 days for me
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

Have a look at Table 13 reg. addresses...I had noticed it before but it didn't sink in that there were 2 addresses missing.

The veroboards arrived today and I already have about 400 LEDs so I'll be making a start pretty soon... smiley-mr-green


BTW it usually takes between 10 and 28 days to the UK.
« Last Edit: November 08, 2012, 02:45:50 pm by Hexadec » Logged

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

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

The software shutdown is implemented by the LSb of the Shutdown open short register.
Hardware shutdown is implemented by the RSTN pin.

According to the datasheet all the RSTN lines are connected together for all chips.

Obviously, the Shutdown open short register is different for each chip...so you need to send 3 commands for 3 chips.  smiley-wink

The decision you have to make is whether you want to seperately Hard reset each AS1130 or whether you want to do them all at once. In the first case you need 3 dedicated pins, in the second only 1.

Or

You can leave the RSTN pins clear of the MCU and just use a button (this is what I have done)
« Last Edit: November 09, 2012, 10:32:04 am by Hexadec » Logged

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

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

You can hard reset all the chips by connecting the RSTN lines together and pulling them to GND.

You can do this either with the MCU or a button (or both)

___________________________________________________________________________________
There is no way of soft resetting all the chips using one command.

Each chip has it's own Shutdown register and you have to clear the shdn bit in each chip seperately.

___________________________________________________________________________________

There might be a way of resetting them all with software but I haven't tried it and the datasheet is not clear about it but you can get all the chips to respond on the same address which may mean that one write to the Shutdown reg. will do them all. You'll have to try it to find out.  smiley-mr-green


Logged

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

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

Answer/Question on your first paragraph:

see attachment!
so if I connect the switch like in the attachment, I can to a hardware reset with the uC AND with the switch if I understood well?

_________________________________________________________________________________________________________
Correct!
Quote
Answer/Question on your second paragraph:

I think I missunderstood you! you meant with "to send 3 commands for 3 chips" that when I send data to the first driver I have to send first his adress and then all HIS registers (with his own Shutdown register) with THEIR specific bits, then when I send data to the second driver I have to send first his adress and then his registers  (with his own Shutdown register) etc?

_________________________________________________________________________________________________________
You don't HAVE to send all the data to each chip to reset it...you just need to write to the Shutdown register.
Quote
In the end I have three methods to reset them??? :
software with their own register, and hardware with a switch & with the uC?
Yep!
Logged

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

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'll let you know about the IRQ when I have my 24x22 matrix finished, but you MUST clear the IRQ by reading the IRQ status register before you can use it AND after every interrupt generated.

I'm thinking that I'll use the MCU to do the timing...but I can't experiment until I've built the boards.  smiley-cool
Logged

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

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

No...if you're not using them you can leave them floating. smiley-mr-green
Logged

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

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

You have to connect the RSTN lines to a pullup resistor and to the switch, so the RSTN lines are pulled up not floating.

It's exactly as your schematic but not connected to the MCU pin.
Logged

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

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That looks OK if you want to have a separate switch to reset the 1130s.

If you also want to reset them under program control you run the "separate Pin" wire to an output on the Arduino and pull that output LOW to reset the chips.

_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: 1 ... 6 7 [8] 9 10 ... 12   Go Up
Jump to: