I2C testing problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C testing problem

375 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hoiyin00 on Tue Apr 29 07:32:56 MST 2014
Hi,
I am trying to a test on I2C on LPC1758 MCB1750 board.
I connect the oscilloscope to SDA2 P0.10 on the board with the GND with VIN- on the board.
With the write signal 0x55, it should genearate a square wave on the oscilloscope.
Anyone know why it does not work?

Code
/****************************************************************************
  i2cmst.c
/****************************************************************************
#include "lpc17xx.h"
#include "type.h"
#include "i2c.h"
#include "driver.h"

extern volatile uint8_t I2CMasterBuffer[I2C_PORT_NUM][BUFSIZE];
extern volatile uint8_t I2CSlaveBuffer[I2C_PORT_NUM][BUFSIZE];
extern volatile uint32_t I2CReadLength[I2C_PORT_NUM];
extern volatile uint32_t I2CWriteLength[I2C_PORT_NUM];

#define PORT_USED2

/*******************************************************************************
**   Main Function  main()
*******************************************************************************/
int main (void)
{

  SystemClockUpdate();

  I2C2Init();/* initialize I2c2 */


while (1)
{
  /* Write SLA(W), address and one data byte */
  I2CWriteLength[PORT_USED] = 1;
  I2CReadLength[PORT_USED] = 0;
  I2CMasterBuffer[PORT_USED][0] = 0x55;
  I2CEngine( PORT_USED );
}


}

/******************************************************************************
**                            End Of File
******************************************************************************/
Labels (1)
0 Kudos
1 Reply

340 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by embd02161991 on Tue Apr 29 14:38:54 MST 2014
Hi,

Please start by using the I2C example from lpcware.com.

http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc17xx-packages

http://www.lpcware.com/content/nxpfile/mcb1700-sample-code-bundle-lpc17xx-peripherals-using-keils-md...


Thanks,

NXP Technical Support
0 Kudos