void my_i2c_start()
{
I20CONSET |= I2C_FLAG_I2EN; // enable i2c
I20CONSET |= I2C_FLAG_STA; // set start flag
}
i see one pulse at 10ms and that it. the clock is always high and the
data is always high except for the pulse.
i'm not exactly sure how the board works...when i initialize or start,
on the sck pin, am i supposed to see a pulse train? or should i create
my own?
--- In l... ,
"abdhjops" wrote: >
> hi,
>
> i'm trying to get the lm75 temp sensor to work on the lpc2148 using the i2c bus. i'm using the IAR IDE so the only RTOS i could get
to
compile is micrium's u-cos2. >
> i was wondering if anyone could help me with the proper sequence to read the sensor. i'm using yuri's code and trying to call it
from
u-cos2: >
> void i2c_lpc_init(int Mode);
> int lm75_read16(int cs_val, int reg, int *ret_val);
> int lm75_read_cfg(int cs_val,int *ret_val);
> int lm75_write16(int cs_val, int reg, int wr_val);
> int lm75_write_cfg(int cs_val,int wr_val);
> int lm75_init();
> int lm75_get_temp(int *ret_val);
>
> thanks,
> mark
>
void my_i2c_start()
{
I20CONSET |= I2C_FLAG_I2EN; // enable i2c
I20CONSET |= I2C_FLAG_STA; // set start flag
}
i see one pulse at 10ms and that it. the clock is always high and the
data is always high except for the pulse.
i'm not exactly sure how the board works...when i initialize or start,
on the sck pin, am i supposed to see a pulse train? or should i create
my own?
--- In l..., "abdhjops" wrote: >
> hi,
>
> i'm trying to get the lm75 temp sensor to work on the lpc2148 using the i2c bus. i'm using the IAR IDE so the only RTOS i could get
to
compile is micrium's u-cos2. >
> i was wondering if anyone could help me with the proper sequence to read the sensor. i'm using yuri's code and trying to call it
from
u-cos2: >
> void i2c_lpc_init(int Mode);
> int lm75_read16(int cs_val, int reg, int *ret_val);
> int lm75_read_cfg(int cs_val,int *ret_val);
> int lm75_write16(int cs_val, int reg, int wr_val);
> int lm75_write_cfg(int cs_val,int wr_val);
> int lm75_init();
> int lm75_get_temp(int *ret_val);
>
> thanks,
> mark
>
Reply by GB●April 23, 20092009-04-23
I have some code at work but one thing you must avoid is reading the device
too often. It's only mentioned in passing on the data sheet, but if you
read too often the A/D conversion never finishes.
----- Original Message -----
From: "abdhjops"
To:
Sent: Thursday, April 23, 2009 7:33 AM
Subject: [lpc2000] LM75 on LPC2148 using I2C > hi,
>
> i'm trying to get the lm75 temp sensor to work on the lpc2148 using the
> i2c bus. i'm using the IAR IDE so the only RTOS i could get to compile is
> micrium's u-cos2.
>
> i was wondering if anyone could help me with the proper sequence to read
> the sensor. i'm using yuri's code and trying to call it from
u-cos2:
>
> void i2c_lpc_init(int Mode);
> int lm75_read16(int cs_val, int reg, int *ret_val);
> int lm75_read_cfg(int cs_val,int *ret_val);
> int lm75_write16(int cs_val, int reg, int wr_val);
> int lm75_write_cfg(int cs_val,int wr_val);
> int lm75_init();
> int lm75_get_temp(int *ret_val);
>
> thanks,
> mark
>
>
Reply by abdhjops●April 23, 20092009-04-23
hi jc,
i looked at your driver code and for whatever reason, i couldn't get it to
properly compile on AIR.
mark
--- In l..., "J.C. Wren" wrote: >
> There's some LM75 driver code in the I2C examples at
http://jcwren.com/arm
>
> --jc
>
> On Thu, Apr 23, 2009 at 10:33 AM, abdhjops wrote:
>
> >
> >
> > hi,
> >
> > i'm trying to get the lm75 temp sensor to work on the lpc2148 using the
i2c
> > bus. i'm using the IAR IDE so the only RTOS i could get to compile
is
> > micrium's u-cos2.
> >
> > i was wondering if anyone could help me with the proper sequence to read
> > the sensor. i'm using yuri's code and trying to call it from
u-cos2:
> >
> > void i2c_lpc_init(int Mode);
> > int lm75_read16(int cs_val, int reg, int *ret_val);
> > int lm75_read_cfg(int cs_val,int *ret_val);
> > int lm75_write16(int cs_val, int reg, int wr_val);
> > int lm75_write_cfg(int cs_val,int wr_val);
> > int lm75_init();
> > int lm75_get_temp(int *ret_val);
> >
> > thanks,
> > mark
> >
> >
> >
>
>
> hi,
>
> i'm trying to get the lm75 temp sensor to work on the lpc2148 using the
i2c
> bus. i'm using the IAR IDE so the only RTOS i could get to compile is
> micrium's u-cos2.
>
> i was wondering if anyone could help me with the proper sequence to read
> the sensor. i'm using yuri's code and trying to call it from
u-cos2:
>
> void i2c_lpc_init(int Mode);
> int lm75_read16(int cs_val, int reg, int *ret_val);
> int lm75_read_cfg(int cs_val,int *ret_val);
> int lm75_write16(int cs_val, int reg, int wr_val);
> int lm75_write_cfg(int cs_val,int wr_val);
> int lm75_init();
> int lm75_get_temp(int *ret_val);
>
> thanks,
> mark
>
>
>
Reply by abdhjops●April 23, 20092009-04-23
hi,
i'm trying to get the lm75 temp sensor to work on the lpc2148 using the i2c
bus. i'm using the IAR IDE so the only RTOS i could get to compile is
micrium's u-cos2.
i was wondering if anyone could help me with the proper sequence to read the
sensor. i'm using yuri's code and trying to call it from u-cos2:
void i2c_lpc_init(int Mode);
int lm75_read16(int cs_val, int reg, int *ret_val);
int lm75_read_cfg(int cs_val,int *ret_val);
int lm75_write16(int cs_val, int reg, int wr_val);
int lm75_write_cfg(int cs_val,int wr_val);
int lm75_init();
int lm75_get_temp(int *ret_val);