Go Down

Topic: multiple I2C led driver hassle (Read 635 times) previous topic - next topic

Boffin1

Jan 06, 2013, 12:28 am Last Edit: Jan 06, 2013, 12:48 am by Boffin1 Reason: 1
I am making a display with 16 text characters ( in two rows of eight )   ( 7x5 matrix ) driven by SAA1064s. 

I have attached a sketch that I want to test it with.  I have only put the bitmaps for 2 letters in  ( A and G ) for testing.

The drivers can only run 4 columns of a 7x5 display, so there are 10 chips for each 8 characters.

I am converting the incoming letters into 5 columns, and putting in an array ( of 80 columns )

I then take 4 columns at a time to feed to the SAA chips.  

The chips only have 4 addresses, so I am using an analog switch to switch the SDA to groups of 4 chips at a time.

You can try running the attached sketch ( I have thrown in comments and some SerialPrints for testing )  and it runs fine for 30 seconds or so, and then

the variable z suddenly jumps to - 2047  and then starts counting up to zero, but the program hangs shortly afterwards.

Code: [Select]
for (z=0; z<=17; z++)  {
   Serial.print(" in loop   z   =  ");        Serial.println(z);



I do not have any chips connected at the moment, and am not sure what the I2C library does if it gets no ack from any chips?

Perhaps it is running out of RAM ?

With my mobile phone I can call people and talk to them -  how smart can you get ?

MAS3

Sounds to me like an overflow.
What if you make z a long instead of an int  ?
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

retrolefty

Quote
I do not have any chips connected at the moment, and am not sure what the I2C library does if it gets no ack from any chips?


Well my experience with using a I2C real time clock module was when the tested sketch was running but the module was not wired up to the two I2C pins that all values would return as 0xFF, and nothing would cause a hang up in the sketch.

Lefty

Boffin1

#3
Jan 06, 2013, 03:13 am Last Edit: Jan 06, 2013, 03:38 am by Boffin1 Reason: 1
Thanks guys

Quote
What if you make z a long instead of an int  ?


its only supposed to go to 18 max?

I tried making z  unsigned int, and it counts properly, but the program still hangs after approx 26 loops.

It will not be repetative in use,  but I dont want it to hang after 26 operations.

I will try claring all values to 0 after transmission??
With my mobile phone I can call people and talk to them -  how smart can you get ?

Boffin1

#4
Jan 06, 2013, 09:27 am Last Edit: Jan 06, 2013, 09:51 am by Boffin1 Reason: 1
mistake 1 :-
I had the thing sending to the chips every iteration of the character number in the main loop--  I have moved the for (z=0; z<=15; z++) to the makeTcols function.

It was still hanging, then I noticed on both the reading column and sending data,  I had been adding 1 to the column count, but it was also happenning on the last 79th count, taking it out of the array size.
so I added a

 
Code: [Select]
textCol [n] = B01100100; if ( n < 79 ){n++;};
    textCol [n] = B10100010; if ( n < 79 ){n++;};
    textCol [n] = B10100010; if ( n < 79 ){n++;};
    textCol [n] = B10000010; if ( n < 79 ){n++;};
    textCol [n] = B01111100; if ( n < 79 ){n++;};


to all the incrementing parts, and its running fine ( on the monitor )
Now its back to the soldering iron to connect all the other chips - deadbug style !

Thanks for the comments guys
With my mobile phone I can call people and talk to them -  how smart can you get ?

Go Up