Frequency of lpc2119 problem with MLX90614

Started by faisal_b2o August 11, 2009
Hi

I have a problem with the frequency of the I2C pin of my lpc2119.
I tried to communicate with a MLX90614, a temperature sensor, its working with SMBUS but I can use it with the I2C register of the lpc2119.

When I set I2SCLL and I2SCLH I cannot have a proprer frequency
I need at least 10 Khz.
Can someone help me ???

Thanks

#define VPBDIV_VAL 4
#define FOSC 19660800
#define PLL_M 3
#define MSEL (PLL_M-1)
#define PSEL0 5
#define PSEL1 6
#define PLLE 0
#define PLLC 1
#define PLOCK 10
#define PLL_FEED1 0xAA
#define PLL_FEED2 0x55

PLLCFG = MSEL | (1< PLLCON = (1< PLLFEED = PLL_FEED1;
PLLFEED = PLL_FEED2;
while (!(PLLSTAT & (1< PLLCON = (1< PLLFEED = PLL_FEED1;
PLLFEED = PLL_FEED2;
MAMCR = 0;
MAMTIM = MAM_FETCH;
MAMCR = MAM_MODE;
VPBDIV = VPBDIV_VAL;

void InitI2C(void)
{
I2CONCLR = 0x36;
PINSEL0 |=( 1UL<<4 | 1UL<<6 );
I2SCLL = 50;
I2SCLH = 50;
I2CONSET = 0x40;
}

An Engineer's Guide to the LPC2100 Series