EmbeddedRelated.com
Forums

LPC2138 I2C

Started by Frank van Eijkelenburg June 18, 2008
Hi,

I am still using the LPC2138 ;). Now I have a problem with I2C. When I
try to send some bytes to an EEPROM device, the following happens:

- I2C start condition is made
- interrupt is generated
- I2C address is sent
- EEPROM device gives an ACK

And now nothing happens. If I look at the I2C bus state, the
microcontroller accepted the ACK. However, no new interrupt is given
due to a bus state change. The SI bit is high in the control register.

Should I continuously receive interrupts when the SI bit is set? If
so, maybe at a higher level the interrupt is turned off. Any other
ideas?

TIA,
Frank
On Jun 18, 4:27 pm, Frank van Eijkelenburg
<fei.technolut...@gmail.com> wrote:
> Hi, > > I am still using the LPC2138 ;). Now I have a problem with I2C. When I > try to send some bytes to an EEPROM device, the following happens: > > - I2C start condition is made > - interrupt is generated > - I2C address is sent > - EEPROM device gives an ACK > > And now nothing happens. If I look at the I2C bus state, the > microcontroller accepted the ACK. However, no new interrupt is given > due to a bus state change. The SI bit is high in the control register. > > Should I continuously receive interrupts when the SI bit is set? If > so, maybe at a higher level the interrupt is turned off. Any other > ideas? > > TIA, > Frank
It is working now. The main problem was in my generic interrupt handling code. After changing the generic interrupt handling, everything worked fine.
On Jun 26, 6:46 am, Frank van Eijkelenburg
<fei.technolut...@gmail.com> wrote:
> On Jun 18, 4:27 pm, Frank van Eijkelenburg > > > > <fei.technolut...@gmail.com> wrote: > > Hi, > > > I am still using the LPC2138 ;). Now I have a problem with I2C. When I > > try to send some bytes to an EEPROM device, the following happens: > > > - I2C start condition is made > > - interrupt is generated > > - I2C address is sent > > - EEPROM device gives an ACK > > > And now nothing happens. If I look at the I2C bus state, the > > microcontroller accepted the ACK. However, no new interrupt is given > > due to a bus state change. The SI bit is high in the control register. > > > Should I continuously receive interrupts when the SI bit is set? If > > so, maybe at a higher level the interrupt is turned off. Any other > > ideas? > > > TIA, > > Frank > > It is working now. The main problem was in my generic interrupt > handling code. After changing the generic interrupt handling, > everything worked fine.
Thanks for the follow-up. I assume it was a fairly simple software bug, not some lurking inconsistency in the way the LPC2138 works? Eric
emeb wrote:
> On Jun 26, 6:46 am, Frank van Eijkelenburg > <fei.technolut...@gmail.com> wrote: >> On Jun 18, 4:27 pm, Frank van Eijkelenburg >> >> >> >> <fei.technolut...@gmail.com> wrote: >>> Hi, >>> I am still using the LPC2138 ;). Now I have a problem with I2C. When I >>> try to send some bytes to an EEPROM device, the following happens: >>> - I2C start condition is made >>> - interrupt is generated >>> - I2C address is sent >>> - EEPROM device gives an ACK >>> And now nothing happens. If I look at the I2C bus state, the >>> microcontroller accepted the ACK. However, no new interrupt is given >>> due to a bus state change. The SI bit is high in the control register. >>> Should I continuously receive interrupts when the SI bit is set? If >>> so, maybe at a higher level the interrupt is turned off. Any other >>> ideas? >>> TIA, >>> Frank >> It is working now. The main problem was in my generic interrupt >> handling code. After changing the generic interrupt handling, >> everything worked fine. > > Thanks for the follow-up. I assume it was a fairly simple software > bug, not some lurking inconsistency in the way the LPC2138 works? > > Eric
Yes, it was a software bug in the code I use. The LPC2138 was working correctly. Frank