Pages: 1 [2] 3 4 ... 8   Go Down
Author Topic: AS1130 Ongoing Discussion 132 Individually controllable, PWM LED driver  (Read 10833 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

I can only assume that there are only the registers that work directly with the LEDs in the FSM.
It also says in the datasheet that to reset ALL the control registers you have to pull RSTN to logic low.

A few points...
I've changed a lot of my code.
I only know what I've learned by experimentation with the chips.
The code is not optimised.


So far it all works great.
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

Your logic is a bit flawed...

How do you come to the conclusion that :

Quote
That means if the Current Source Register is once set, it can only be reset by making a reset by pulling RSTN to low? And it can't be reset by the 'init bit'?

especially as I've posted numerous examples of changing the CS reg value while the chips are running...  smiley-eek-blue

I would strip down the code to it's simplest form and get 1 picture showing on your matrix to test the hardware etc. before going any further.
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

Tip:

You can use the AS1130_status_all() function to read out the control registers at any point.   smiley-wink

« Last Edit: December 29, 2012, 07:21:41 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

Quote
of course I already have a code for one matrix,

That's not what you said in your previous statements.  smiley-roll-blue

Quote
mounted yeah, going no. the code isn't working.

I also don't understand what it is you are asking if my answer above is not what you want.

If you do a hard reset then the MCU sends the setup data to the AS1130 from the start...including the CS reg.
If you only do a soft reset with the shdn then the CS reg doesn't change as far as I know from experimentation.

The trouble is (in my experience)...you make statements that are wrong...argue about the answer and then go on to another subject and repeat the cycle.


Either your code works or it doesn't...that is still unclear.
Does your hardware work?
What is it that doesn't work?

Post your hardware setup.
Post your code to run it.
Indicate what isn't working.

Then we might get somewhere... smiley-wink
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

Your original question:

Quote
If you do a software reset and set the shdn-bit to 0, are all controll registers resetted then (set to default
values) ? because thats not written in the datasheet.

What you say now:

Quote
And i'm not talking anymore about the shdn-bit but about the init-bit.

You've already said that your code isn't working so...

Quote
And I have a second code for two matrix, where I just wanna understand the logic

...makes no sense. 2 chips running is virtually the same as 1 chip running...they both get the same code.
Also, if you can't get 1 chip to work, what makes you think that understanding 2 chips working will make it better?

Quote
the CS is 0x00, so the leds won't light!
This statement is true...you have to set it between 1 and 255 to make the LEDs light up.

Quote
Both codes are yours which you posted here.
My code runs perfectly on my hardware as shown by various videos I've posted.
If you have EXACTLY the same hardware and use my code it will work perfectly.

If you don't...then it's no wonder it won't work.
If you modified the code to work on your hardware, then it is YOUR code that doen't work.

Quote
My hardware is working for sure, I measured each pass.

What did you measure and what do you mean by a 'pass'?



No wonder I am confused...
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

OK..got your code...

I've got to go out for a couple of hours but will have a look when I get back.

Quote
when I uncomment the for-loops the programm crashes!

Most of the program is for loops...which crashes...?

What does the compiler say?

Be back soon... 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

Quote
the compiler crashes!

If the compiler crashes...I'd get a new one.... smiley-mr-green smiley-mr-green

Do you mean that your programme won't compile?

If so...what does the compiler say? Post the output.
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

..and you say it compiles if you comment out certain parts...

which parts?
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've no idea why your compiler crashes...

but I can see several reasons your code won't compile.

This is just on a quick scan.

1) You declare I2C_write as returning unsigned char...it should be void.
2) You declare:

Code:
void AS1130config(unsigned char ram, unsigned char command, unsigned char data)

then call AS1130_config(i, 2*j+1, Frames_Data[data]); twice!! (what do you think is wrong with that?)

3)Will your compiler allow inline declarations? ie
Code:
for (int i=0x01;i<=0x24; i++)

or do you have to declare them first?
Code:
int i,j,k;

whichever it is you have done both in the same function and you can't declare i as an integer AND an unsigned char in the same bit of code.
4) You've declared Frames_Data[0x360] and then try to step through it using an int. Does your compiler treat int as signed/unsigned or 8 or 16 bit?

5) Will your compiler allow you to define AS1130CONFIG as a constant and then declare AS1130config as a function name?

6) ALL your initial declarations are wrong...they should be #defines NOT variables.




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 need a good book on C/C++ programming.

I don't believe your compiler has no #define directive...every compiler I have ever seen allows #define it is standard in c.

You need to read through my reply again...

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

why do I need to read through your reply again? Is there something I missunderstood?

You CAN'T be serious?  smiley-eek
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

void AS1130config(unsigned char ram, unsigned char command, unsigned char data)

Quote
then call AS1130_config(i, 2*j+1, Frames_Data[data]); twice!! (what do you think is wrong with that?)

Tell me what you don't understand about that.


It just demonstrates again how much trouble you cause and how little effort you put in when you get an answer.

I might also point out that you came here asking about the shdn bit...implying that was why your programme won't work. You then moved on to the init bit and the CS register also implying that these were reasons your code doesn't work.

After quite a bit of wasting my time...it turns out that your program doesn't compile... smiley-eek-blue smiley-eek-blue smiley-eek-blue and that you can't even be bothered to copy and paste the code I provided (as is shown above).

You also state
Quote
Nope, that's a part of your code I didn't change. I don't call it twice.

Which is TOTAL rubbish...You DO call it twice and you DID change it (again as is shown above).

I am the only one helping you with your project...try putting in some effort or do as I suggested when you frustrated me to the point of giving up in the other thread you cluttered up with your problems...
« Last Edit: December 30, 2012, 07:31:21 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

Quote
You don't know how much time I'm investigating in this project.

So...why should I care?
How much time have I wasted trying to help you out?

Quote
But I also have to do lots of other things that I can't concentrate the whole time on only this project

Yeah, me too. I could be doing lots of other things rather than being conned into teaching you C programming.

Quote
Please don't be angry, I'm really thankful for your help!

Good...I'm glad you appreciate it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quote
So the only problem is that underscore?

Errrr NO there are lots of problems....

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quote
I just have to change it like that: AS1130config(i, 2*j+1, Frames_Data[data]);

If you do that you are making the problem worse. (read my reply above again/properly)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quote
and then it's okay?

No...your attempt at compiling has many problems not the least of which is this one.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quote
or what do you still mean with 'calling it twice'?

Code:
AS1130_config(i, 2*j+1, Frames_Data[data]); <------FIRST CALL
    data++;
AS1130_config(i,2*j,   Frames_Data[data]);    <-----SECOND CALL
    data++;

It doesn't matter if you call it once or 1000 times...it still won't compile until you call a function that exists.

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

That would work...but why change things even more?

This could cause more problems later when you copy and paste more of my code.

All you had to do is put in the underscore in the places that it's missing.
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

Quote
because the compiler doesn't work with underscores!

Now I'm getting more and more convinced you are taking the mickey.

You say you are using a compiler that won't allow underscores, doesn't allow the #define directive and won't let you include header files.

All I can say to that is BOLLOX

Goodbye...I'm sure you've provided lots of entertainment for the readers of this and the other thread you filled with your bullshit.

I will be ignoring you from now on.
Logged

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

Pages: 1 [2] 3 4 ... 8   Go Up
Jump to: