Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

I2C does not generate interrupt after writing or reading

I2C does not generate interrupt after writing or reading

2005-08-01 by catstransport

I have a problem with my lpc2292.
The I2C bus does not generate a interrupt after a writing or a
reading. When I set the interrupt manually by setting the i2c
interrupt bit high then it comes in my isr routine.

I have tried several things but it all doesn't generate a interrupt.

best regards, 

Remco 

If one cannot enjoy reading a book over and over again, there is no use
in reading it at all.
                -- Oscar Wilde

RE: [lpc2000] I2C does not generate interrupt after writing or reading

2005-08-01 by James Dabbs

> I have a problem with my lpc2292.
> The I2C bus does not generate a interrupt after a writing or 
> a reading. When I set the interrupt manually by setting the 
> i2c interrupt bit high then it comes in my isr routine.

I am in the late stages of trudging through an interrupt-driven I2C
interface for the 2106..  I believe it's the same hardware.

The I2C system interrupts you only on a 'state change'.  Therefore, you
have to read/write the data port at the right time to result in an
interrupt.  In my case, I had to set the STA flag, write bytes, then set
the STO flag.  I got an interrupt after setting the STA flag and after
each write.

I can see how setting the interrupt bit high will force the issue but
then your status register will probably only give you an 0xf8.

Good luck.

Re: I2C does not generate interrupt after writing or reading

2005-08-01 by catstransport

--- In lpc2000@yahoogroups.com, "James Dabbs" <jdabbs@t...> wrote:
> > I have a problem with my lpc2292.
> > The I2C bus does not generate a interrupt after a writing or 
> > a reading. When I set the interrupt manually by setting the 
> > i2c interrupt bit high then it comes in my isr routine.
> 
> I am in the late stages of trudging through an interrupt-driven I2C
> interface for the 2106..  I believe it's the same hardware.
> 
> The I2C system interrupts you only on a 'state change'.  Therefore, you
> have to read/write the data port at the right time to result in an
> interrupt.  In my case, I had to set the STA flag, write bytes, then set
> the STO flag.  I got an interrupt after setting the STA flag and after
> each write.
> 
> I can see how setting the interrupt bit high will force the issue but
> then your status register will probably only give you an 0xf8.
> 
> Good luck.

I set my sta flag. And still I get no interrupt from the i2c. I is
very strange.

I will try writing it directly. Maybe that it helps.

Re: I2C does not generate interrupt after writing or reading

2005-08-01 by catstransport

--- In lpc2000@yahoogroups.com, "James Dabbs" <jdabbs@t...> wrote:
> > I have a problem with my lpc2292.
> > The I2C bus does not generate a interrupt after a writing or 
> > a reading. When I set the interrupt manually by setting the 
> > i2c interrupt bit high then it comes in my isr routine.
> 
> I am in the late stages of trudging through an interrupt-driven I2C
> interface for the 2106..  I believe it's the same hardware.
> 
> The I2C system interrupts you only on a 'state change'.  Therefore, you
> have to read/write the data port at the right time to result in an
> interrupt.  In my case, I had to set the STA flag, write bytes, then set
> the STO flag.  I got an interrupt after setting the STA flag and after
> each write.
> 
> I can see how setting the interrupt bit high will force the issue but
> then your status register will probably only give you an 0xf8.
> 
> Good luck.

I still have no luck with the I2C on the lpc2292.
My init for i2c are:
i2cconclr=0x6c;  //i2conclr all bits
temp32 = pclk / 50000
scll = temp32/2
sclh = temp32-scll
i2conset = 0x40

The interrupt is set just like the uarts and those are working.
by writing to the i2c device i do this
clear stopbit
clear interrupt bit
i2conset  0x60 //set start flag
               //set enable 

then a wait till the isr change the status of my register.
but the isr does not start at all. i2c does not generate a interrupt.
Does anyone know what i do wrong.

regards,

Remco

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.