1

Although not directly related to the Raspberry Pi, the piece of hardware I'm attempting to understand can be utilized by the Pi and it's a relatively basic concept that I'm looking for more information on, I'm just not sure what it is called to research it.

The PCA9865 Servo Driver allows you to control up to 16 servos and they can be chained together to drive hundreds of servos. Each board has a series of 6 jumpers that can be added to in order to create separate addresses to send data to.

From the manual:

Addressing the Boards Each board in the chain must be assigned a unique address. This is done with the address jumpers on the upper right edge of the board. The I2C base address for each board is 0x40. The binary address that you program with the address jumpers is added to the base I2C address. To program the address offset, use a drop of solder to bridge the corresponding address jumper for each binary '1' in the address.

It continues:

Board 0: Address = 0x40 Offset = binary 00000 (no jumpers required)

Board 1: Address = 0x41 Offset = binary 00001 (bridge A0 as in the photo above)

Board 2: Address = 0x42 Offset = binary 00010 (bridge A1)

Board 3: Address = 0x43 Offset = binary 00011 (bridge A0 & A1)

Board 4: Address = 0x44 Offset = binary 00100 (bridge A2)

If you would like to review the manual, pages 13 and 14 of this PDF contain the same information. PDF HERE

I'd like to understand how to address all 62 possible boards that I could chain together. Right now, I'm not sure what I need to understand in order to address the boards outside of the 5 example board addresses above.

If anyone cares to enlighten me that would be appreciated. Thanks.

2

A5 to A0 should be thought of as a binary number. Ax is 1 if there is a solder bridge, otherwise 0.

A5 A4 A3 A2 A1 A0 Decimal
 0  0  0  0  0  0  0
 0  0  0  0  0  1  1
 0  0  0  0  1  0  2
 0  0  0  0  1  1  3
 0  0  0  1  0  0  4
 0  0  0  1  0  1  5
 0  0  0  1  1  0  6
 0  0  0  1  1  1  7
 0  0  1  0  0  0  8
...
 1  1  0  1  0  1  53
 1  1  0  1  1  0  54
 1  1  0  1  1  1  55
 1  1  1  0  0  0  56
 1  1  1  0  0  1  57
 1  1  1  0  1  0  58
 1  1  1  0  1  1  59
 1  1  1  1  0  0  60
 1  1  1  1  0  1  61
 1  1  1  1  1  0  62
 1  1  1  1  1  1  63

Add the decimal equivalent to the base address (64) to get the resulting I2C address.

Basically the combination of solder blobs on A0 - A5 must be unique for each board (as each I2C device needs a unique bus address).

You don't have to use consecutive addresses.

| improve this answer | |
  • Thanks Joan, but please teach me how to add? How is 53: 1 1 0 1 0 1 and how is 63: 1 1 1 1 1 1 I understand to think of it like binary, I'm just not sure of the significance of the places or what you mean by add the decimal equivalent to the base address (64). For this device, the base address is 40, and the A5-A0 values are added to 40. Should I count the same way as binary only using 6 spaces instead of 8? Correct? – user2355051 Aug 27 '19 at 12:24
  • The problem is three different number representations are in play here, binary, decimal, and hex (0x40). You need to find an on-line tutorial to explain these concepts. – joan Aug 27 '19 at 12:27
  • There's an animation about 1/3rd of the way down this page. If I understand you correctly, I should count using binary up to six spaces and add that number to the base address? mathsisfun.com/binary-number-system.html – user2355051 Aug 27 '19 at 12:27
  • Thanks Joan, I think I got it. I need to count in binary, what was throwing me was only six places, that's the limit of the number system / addressing of the board. So 0 is nothing, six would be 000110. Much appreciated! – user2355051 Aug 27 '19 at 12:33
  • That's good. Like all things it is simple once it clicks (a bit like me with cryptic crosswords). – joan Aug 27 '19 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.