This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2C issue in wince6.0...

Other Parts Discussed in Thread: OMAP3530

hi

we r using OMAP3530 under WINCE6.0.... using EVM3530 platform....

can u provide some examples used to READ /write I2C.... we tried using TUX_i2c sample code which available in BSP....

we were able to open I2C2 handle...but not able write as per protocol... we monitored the SDA signal on CRO..the 1st byte was ACked,,, and found out that no ACKs were coming frm Slave after the 1st byte sent frm master..

can pls clear the concept of SUB-ADDRESS used in TUX_I2c... is it cmd code that has to be sent to slave... or is it the 2nd byte that the slave is expecting... 

waiting for help....

thnx ...

  • Hi,

    You need to use I2COpen to open handle to the I2C Interface and argument for this is I2CGetDeviceIdFromMembase(I2C Bus Base Address)

    Then set the slave address using I2CSetSlaveAddress API.

    Set the Subaddress mode using I2CSetSubAddressMode API. Then use I2CWrite and I2CRead API's to write and read to I2C devices.

    Regards,

    GSR

  • hey friend.....

    im able read/write single byte using I2CRead() and I2CWrite()...... but only problem is cannot write block of data... in which im interested....

    for example my slave addr is 0x65, sub_addr_mode is 1(for 1 byte sub_addr), and data buffer is

    buffer[29]={0xa,0x55,0x45,0xab................etc...........0x11};

    but not able to send it at a stretch to the slave using single I2Cwrite(); i think I2cWrite() API has a limitation of writing single byte at a time.....my slave expects a STOP BIT only after completely writing all the 29 bytes of buffer[29]....

    but a stop bit is coming just after writing the 1st data byte of buffer[29]....im able see this on the CRO.....i tried changing size of write by passing "count"=29  in 

       I2CWrite(hI2C, subAddress, buffer, count); but still not working....... the RETAILMSG still shows writecount=1 during the execution of the exe......

    can u throw some light on it.....

    once again im reminding u... that im able to do a SINGLE byte READ/WRITE...... this implies my communication channel between master n slave is through... opening the handle... setting slave addr... setting baud index...setting sub addr mode.. setting sub addr.... sending single byte is succeeding...

    thnx in advance..... :) 

  • Hi,

    As far as I know the last parameter of the I2CRead API is read count and for I2CWrite API it is write count.

    The best thing to do is if you have BSP, build the BSP with KITL and KDBG Enabled put a break point and see what is happening inside API's. If break points doesn't make sense then put some RETAIL or DEBUGMSGS.

    I am not familiar with the BSP that you are using. But I have used some BSP's for OMAP3530 in which the last argument is count for I2CRead and I2CWrite.

    Regards,

    GSR