Forums - I2C operation

2 posts / 0 new
Last post
I2C operation
Join Date: 27 Jul 16
Posts: 35
Posted: Fri, 2016-08-19 01:03

I used two PIOs as sda and scl for I2c communicates with a lumen sensor. I used PIO9 as SDA and PIO10 as  SCL. they are pulled-up to 3.3v with a 10k resister.I have init the I2c as follow, but i get none response when i tried to send command to sensor to config. I tried to check I2C status and I2cready() always returns false;

I2c Init code:

  PioSetModes(    ((0x01L << CSR_LUMEN_PIO_SDA) | (0x01L << CSR_LUMEN_PIO_SCL)), 
    /* Configure the PIOs as Input */
    PioSetDirs(     ((0x01L << CSR_LUMEN_PIO_SDA) | (0x01L << CSR_LUMEN_PIO_SCL)), 
    PioSetPullModes(((0x01L << CSR_LUMEN_PIO_SDA) | (0x01L << CSR_LUMEN_PIO_SCL)), 
    PioSetEventMask(((0x01L << CSR_LUMEN_PIO_SDA) | (0x01L << CSR_LUMEN_PIO_SCL)), 
    /* Configure the I2C controller */
    /* Configure pull mode of the I2C pins */
    /* Configure the I2C clock */
    /* Enable the I2C controller */
after init , I tried to config the sensor
and operation failed.
does anybody can help me ?



  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Sat, 2016-08-27 10:39

This is an error "PioSetModes(    ((0x01L << CSR_LUMEN_PIO_SDA) | (0x01L << CSR_LUMEN_PIO_SCL)),                                         pio_mode_user);"

The PIO has to be defined as I2C no user mode. see pio.h

See I2C.h for demo. 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.