Reply
Posts: 3
Registered: ‎03-30-2015

CP2112 I2C write request

I'm trying to use CP2112-EK to communicate with this MAX3601 IC using I2C.

 

I went through the sample program and this AN496 document. I have tried reading and writing using the sample program.

 

From the MAX3601 datasheet they specify 0xE2 for write address and 0xE3 for read address. But from the CP2112 docs it seems that the slave address cannot be 0xE3.  So I input 0xE2 for both read and write for the sample problem.  Reading seems fine, but write does not seem to work properly. I'm not sure how it's actually writing because I cannot specify the write to address on the slave device. It seems that in the API there's no write request method with both slave address and the register address to write to??

 

How do you specify where to write then? what is this buffer address below?

 

Prototype: HID_SMBUS_STATUS HidSmbus_WriteRequest (HID_SMBUS_DEVICE device, BYTE
slaveAddress, BYTE* buffer, BYTE numBytesToWrite)
Parameters: 1. device is the device object pointer as returned by HidSmbus_Open().
2. slaveAddress is the address of the slave device to write to. This value must be between 0x02
- 0xFE. The least significant bit is the read/write bit for the SMBus transaction and must be 0.
3. buffer is the address of a buffer to be sent to the device.
4. numBytesToWrite is the number of bytes to write to the device (1–61). This value must be less
than or equal to the size of buffer.

 

I'm a little lost here.

 

Posts: 8,069
Registered: ‎08-13-2003

Re: CP2112 I2C write request

From the MAX3601 datasheet they specify 0xE2 for write address and 0xE3 for read address. But from the CP2112 docs it seems that the slave address cannot be 0xE3.  

 

you need to understand I²C

 

I²C Specification: http://www.nxp.com/documents/user_manual/UM10204.pdf

 

erik
Highlighted
Posts: 3
Registered: ‎03-30-2015

Re: CP2112 I2C write request


erikm wrote:

From the MAX3601 datasheet they specify 0xE2 for write address and 0xE3 for read address. But from the CP2112 docs it seems that the slave address cannot be 0xE3.  

 

you need to understand I²C

 

I²C Specification: http://www.nxp.com/documents/user_manual/UM10204.pdf

 


eh... thanks.

 

I'm a newbie indeed. But I just found it strange that addresses are said to be 7 bit (1110 001) then to specify if it's R/W it adds another bit making it 8. Then saying  1110 0010 is W and 1110 0011 is R. Then in the CP2112 program it asks to enter the Read address as 1110 0010 and not 1110 0011. Obviously the API changes the LSB to reflect R or W. It was just a little confusing.

 

For the second question I just figured it out... you just put both the write address and data in the text field.