16x2 RGB Shield Address change?

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rodcar125
 
Posts: 9
Joined: Tue Mar 11, 2014 11:02 pm

16x2 RGB Shield Address change?

Post by rodcar125 »

Hello!

I bought two 16x2 RGB shields and thought i could make them work separately. I used a little program to search the IC2 bus for addresses but it only finds one address: 0x20. With only 1 address on the bus and when attached both shields to the SDA and SCL pins, whenever i send a command it does the same thing on both LCDs.

Is there any way to change the address of the shields in order to talk to them separately?

You can see my setup on the image below:
Both LCDs showing the same thing. Clock and data cables not connected to the arduino in this photo. Work in progress.
Both LCDs showing the same thing. Clock and data cables not connected to the arduino in this photo. Work in progress.
SU.gif (405.17 KiB) Viewed 513 times
Note: The SDA (yellow) and SCL (blue) cables are not connected to the arduino in this photo. I have them connected now.

Ill try to add another photo soon showing both LCDs displaying the same thing.

Thanks! (:

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: 16x2 RGB Shield Address change?

Post by adafruit_support_bill »

The shield uses the default address for the MCP23017 i2c port expander chip. The chip does have 3 address pins and it is possible to re-address the shield with a bit of hacking.

Here are the links to the schematics and data sheets. The address pins (15, 16 & 17) are currently all tied to GND. You can pull one or more of them high with a jumper to change the address.
https://github.com/adafruit/Adafruit-RGB-LCD-shield
http://www.adafruit.com/datasheets/mcp23017.pdf

User avatar
rodcar125
 
Posts: 9
Joined: Tue Mar 11, 2014 11:02 pm

Re: 16x2 RGB Shield Address change?

Post by rodcar125 »

Great, I'll give it a try and report back

Thanks a lot!

Rodrigo

User avatar
rodcar125
 
Posts: 9
Joined: Tue Mar 11, 2014 11:02 pm

Re: 16x2 RGB Shield Address change?

Post by rodcar125 »

Hi again,

Maybe this is a silly question but do i just connect a 5V cable to any of the pin number 15, 16 or 17? does the shield has specific pins i could connect them to? i reviewed the schematic you posted searching for the pin from the IC to the board but i can figure it out ):

Thanks again!

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: 16x2 RGB Shield Address change?

Post by adafruit_support_bill »

The pins now are connected to ground. If you just connect 5v to it, you will create a short circuit. You need to cut the pin where it is soldered to the shield, bend it out away from the board, then solder a jumper from it to 5v.

User avatar
rodcar125
 
Posts: 9
Joined: Tue Mar 11, 2014 11:02 pm

Re: 16x2 RGB Shield Address change?

Post by rodcar125 »

Really glad I asked before doing something stupid!

I have desoldered the pin 15 from the board and solder a jumper to that pin. I added a couple drops of hot silicone for support since the leg its too weak.
Jumper on pin 15 (A0) for address change
Jumper on pin 15 (A0) for address change
RGBShield with jumper on pin15.jpg (355.18 KiB) Viewed 474 times
Ill try it as soon as i get home (:

I suppose ill have to create two different instances of the Adafruit_RGBLCDShield for the LCDs right?
something like:

Code: Select all

Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
Adafruit_RGBLCDShield lcd2 = Adafruit_RGBLCDShield();

User avatar
rodcar125
 
Posts: 9
Joined: Tue Mar 11, 2014 11:02 pm

Re: 16x2 RGB Shield Address change?

Post by rodcar125 »

I connected everything and ran the I2C scanner...
Screen Shot 2014-05-23 at 4.14.22 PM.png
Screen Shot 2014-05-23 at 4.14.22 PM.png (5.2 KiB) Viewed 470 times
Awesome!!

Now ill try to figure out how to talk to each one.

Thanks a lot Bill!!
Awesome support team

User avatar
mikel_hubo
 
Posts: 3
Joined: Wed Mar 04, 2015 12:56 pm

Re: 16x2 RGB Shield Address change?

Post by mikel_hubo »

Hi,

had the same adress conflict and solved it to 20 and 22

Where in the driver software do I have to change the adress to 22 now ?

thx for helping

mikel

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: 16x2 RGB Shield Address change?

Post by adafruit_support_bill »

On line 119 of Adafruit_RGBLCDShield.cpp

To change from 20 (the default) to 22, change:

Code: Select all

    _i2c.begin();
To:

Code: Select all

    _i2c.begin(2);

User avatar
mikel_hubo
 
Posts: 3
Joined: Wed Mar 04, 2015 12:56 pm

Re: 16x2 RGB Shield Address change?

Post by mikel_hubo »

Hi and thanks for the quik answer.

I got a next one question on this,

where do I find the source code of Adafruit_RGBLCDShield.cpp

thx for helping

mikel

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: 16x2 RGB Shield Address change?

Post by adafruit_support_bill »

The library code is here in github:
https://github.com/adafruit/Adafruit-RG ... ld-Library

User avatar
mikel_hubo
 
Posts: 3
Joined: Wed Mar 04, 2015 12:56 pm

Re: 16x2 RGB Shield Address change?

Post by mikel_hubo »

Thanks a lot !

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”