Pages: [1]   Go Down
Author Topic: multiple I2C led driver hassle  (Read 610 times)
0 Members and 1 Guest are viewing this topic.
Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* forumsketch.pde (9.36 KB - downloaded 14 times.)
« Last Edit: January 05, 2013, 06:48:58 pm by Boffin1 » Logged

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

The Netherlands
Offline Offline
Edison Member
*
Karma: 50
Posts: 1673
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds to me like an overflow.
What if you make z a long instead of an int  ?
Logged

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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??
« Last Edit: January 05, 2013, 09:38:47 pm by Boffin1 » Logged

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

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
« Last Edit: January 06, 2013, 03:51:51 am by Boffin1 » Logged

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

Pages: [1]   Go Up
Jump to: