LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 04-08-2016, 07:46 PM   #1
Jerry1947
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Rep: Reputation: Disabled
Question i2cdetect command does not locate attached MCP23017 port expander


Hi:

I am attempting to get a Raspberry Pi to communicate with a MCP23017 port expander via the I2C interface. The address pins
A0, A1 & A2 on the expander are all hard wired to 0. When I executed the i2cdetect command the response was:

$ sudo i2cdetect -l
i2c-1 i2c bcm2708_i2c.1 I2C adapter

I then ran the same command with i2cbus set to 1 and again with it set to abcm2708_i2c.1 and received the following response both time:

pi@raspberrypi ~ $ sudo i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

According to the documentation I have the output should be:

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

Finally I ran the command with the F option with -F 1 and again with -F bcm2708_i2c.1 and it seemed to work OK although I would have expected it to fail also.


Does anybody have an idea as to why I'm NOT seeing the "20"?
Also the man page says that the "UU" indicates probing was skipped because this address is currently in use by a driver. Since this not the address I'm interested in should I be concerned about the"UU"?


Thanks

Jerry
 
Old 04-10-2016, 06:23 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
As far as I know the output of -F displays information about the adapter on the Pi not what is attached to the bus. Do you have any other i2c software etc running? I would be a little curious since your device is not being detected at the desired address.

By 0 I assume you mean ground. Are all the ground pins tied together? What are you using for VDD i.e. 3 or 5 VDC and where are you getting the power from? Did you connect pin 18 (reset) to VDD?
 
1 members found this post helpful.
Old 04-12-2016, 07:53 PM   #3
Jerry1947
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
As far as I know the output of -F displays information about the adapter on the Pi not what is attached to the bus. Do you have any other i2c software etc running? I would be a little curious since your device is not being detected at the desired address.

By 0 I assume you mean ground. Are all the ground pins tied together? What are you using for VDD i.e. 3 or 5 VDC and where are you getting the power from? Did you connect pin 18 (reset) to VDD?
Michael:

I read your reply and then realized that although I had tied together the grounds on the power supplies and the MCP23017 boards
I had failed to connect them to the Raspberry Pi ground. When I did this the i2cdetect showed the correct X20 address.


Thank You so much for your help

Jerry
 
Old 04-12-2016, 08:00 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Glad you got it working. You can mark the thread as solved via the thread tools pull down menu at the top of the page.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Locate Files On Server - Where is port 8080 pointing? Wad3 Linux - Server 4 08-16-2012 07:50 PM
How can I say mouse is attached or not attached at the serial port ? lovelylinux Linux - Hardware 1 02-07-2007 09:44 AM
Serial Mouse is attached or not attached at seiral port lovelylinux Linux - Hardware 1 01-28-2007 07:21 PM
cpan> locate -u Unknown shell command 'locate -u'. Type ? for help. sharad2005 Linux From Scratch 1 08-04-2006 12:40 AM
Promise PDC20376 wont see the disk attached to the P-ATA port! NickLess Debian 4 09-13-2004 02:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 06:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration