AnsweredAssumed Answered

basic i2c example lpc54628

Question asked by dustin kimble on May 28, 2018
Latest reply on Jun 1, 2018 by Victor Jimenez

Hi,

 

I am trying to interface to a gps module using i2c : 

https://www.u-blox.com/sites/default/files/NEO-M8-FW3_DataSheet_%28UBX-15031086%29.pdf 

(interface packaged i am using ) neoPLC GPS - High Speed, High Precision GPS for Arduino — neoPLC 

 

I want the LPC to be the master and the gps to be the slave. (using polling)

 

I can't seem to get it to work following and modifying any of the i2c examples from the sdk.

I have configured the pins i am using in the pinmux.c file, following the example code:

const uint32_t port0_pin13_config = (
IOCON_PIO_FUNC2 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is enabled */
IOCON_PIO_OPENDRAIN_EN);

IOCON_PinMuxSet(IOCON, 0U, 13U, port0_pin13_config);

const uint32_t port0_pin14_config = (
IOCON_PIO_FUNC2 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is enabled */
IOCON_PIO_OPENDRAIN_EN);

IOCON_PinMuxSet(IOCON, 0U, 14U, port0_pin14_config);

 

Some questions: 

  1.  Should I be following the examples with "master" or "slave" in the title? I can't get either to work. I do believe I should be following the "master" example though, which is the one i've been messing with the most.
    1.  
  2. Does the naming scheme Flexcomm0...Flexcomm8 also relate to the I2C0_BASE...I2C8_BASE variables int the code?
  3. When I plug the device into 3.3v and gnd , the devices sda and sdl are held at 3.28v....not sure if this is normal.

 

Any ideas? 

Or if someone can post a very basic stripped down version using i2c to communicate with a slave device?

 

Thank you!

Outcomes