edlins / libPCA9685

superfast PCA9685 library for Debian platforms. developed on Raspbian on a Pi B+.
MIT License
13 stars 8 forks source link

SUBADRx bits should not be used by default #10

Closed pvint closed 6 years ago

pvint commented 6 years ago

When I "fixed" my lockup problem in #2 I added the sub address bits (_PCA9685_SUB[1-3]BIT) but I should not have.

After running init with these set the PCA9685 sets more I²C addresses.

My device's base address is 0x70, here is output from i2cdetect -y 1 before init with those bits set:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: UU -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- --                         

And here is what I see after running init:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: UU -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 71 72 -- 74 -- -- -- 

(The device at 0x48 is a temp sensor and is not relevant to this issue)

Removing the SUB bits prevents this, but I still need the ALLCALL bit set for my device to work.

(TODO: I would like to add the use of the SUB bits, as it would be nice to have groups so I can control certain zones of lights together!)

edlins commented 6 years ago

So I'm looking deeper into this and this is what I've found.

pvint commented 6 years ago

Good stuff. I'd like to understand the SUBx addresses as well (especially because I think I would like to use them!).

As luck would have it I received new PCBs today and plan to assemble a couple tonight. On the off chance that it's something off with my particular PCA9685 device I was testing with I will make sure to use parts from the new batch.