MCP23017 ADC detail

Status
Not open for further replies.

fan174

Member
I want to know how to operate an MCP23017 I'd have a looked at datasheet and source code

https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf

device opcode which seems to be being used meaning the slave address.

slave address is shown 0 1 0 0 A2 * A1 * A0 * R/W in datasheet

source code **broken link removed**

I am not familear with c++ and given hardware, I do not understand Why 0x2o is the address of Slave, can somebody tell me reason ?
 
Try working with any IIC device and you'll start to understand it.

Mike.
 
The I2C device address only uses seven bits, then the R/W bit.

Some things show the address left-aligned (as with the register bits in the datasheet), some things show it right-aligned then shift it and add in the R/W bit as part of the I2C subroutines...

The 0x20 address is right-aligned, so the range is 0-127.
When transmitted and the R/W bit added in, it becomes 0x40 or 0x41.

It can be confusing when trying to cross reference addresses and literal data values.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…