I2C interrupt

Started by Ken August 24, 2004
I am having problems getting the I2C interrupt to work. I have setup
the VIC to enable the I2C interrupt (channel 9) in exactly the same
way I have setup all the other interrupts (which work).

I can see that the SI bit is getting set correctly - and I can use
the I2C interface by polling this - but the ISR is not executing.

Does the I2C interrupt have to be enabled anywhere else or is setting
up the VIC enough? The UART requires an enable bit to be set also
but I cannot find an equivalent for I2C.

The samples in the files section seem to also use polling. Any help
appreciated.

Thanks!



An Engineer's Guide to the LPC2100 Series

Hi

I use I2c with interrupt and it's work fine

example of my code in new0001.c

jean-baptiste

>>> 24/08/04 17:40:16 >>>
I am having problems getting the I2C interrupt to work. I have setup
the VIC to enable the I2C interrupt (channel 9) in exactly the same
way I have setup all the other interrupts (which work).

I can see that the SI bit is getting set correctly - and I can use
the I2C interface by polling this - but the ISR is not executing.

Does the I2C interrupt have to be enabled anywhere else or is setting
up the VIC enough? The UART requires an enable bit to be set also
but I cannot find an equivalent for I2C.

The samples in the files section seem to also use polling. Any help
appreciated.

Thanks!

Yahoo! Groups Links
To



Hi,

Thanks for the info - where can I get a copy of the source file? I
have looked in the files section but cannot see it.

Regards.

--- In , "Jean-Baptiste Houdry" <jean-
baptiste.houdry@s...> wrote:
> Hi
>
> I use I2c with interrupt and it's work fine
>
> example of my code in new0001.c
>
> jean-baptiste
>
> >>> anotheruglygeek@y... 24/08/04 17:40:16 >>>
> I am having problems getting the I2C interrupt to work. I have
setup
> the VIC to enable the I2C interrupt (channel 9) in exactly the same
> way I have setup all the other interrupts (which work).
>
> I can see that the SI bit is getting set correctly - and I can use
> the I2C interface by polling this - but the ISR is not executing.
>
> Does the I2C interrupt have to be enabled anywhere else or is
setting
> up the VIC enough? The UART requires an enable bit to be set also
> but I cannot find an equivalent for I2C.
>
> The samples in the files section seem to also use polling. Any
help
> appreciated.
>
> Thanks! >
>
> Yahoo! Groups Links
> To >
>




I don't if this will help you much as I've no idea what uC you are
using but I'm currently in the process of developing an I2C interface
myself. I have the SI interrupt working correctly. The set up code
for the interrupt is straight forward and looks something like this:

VICVectAddr4 = (unsigned long) i2c_si_isr; //set intrpt vector addr
VICVectCntl4 = 0x20 | 9; //use VICVectAddr4 as SI intrpt
VICIntEnable = 1 << 9; //enable SI intrpt

The ISR looks something like this:

void i2c_si_isr(void) __irq {
unsigned long intrptSwap;

tempIntrpts = VICIntEnable; // save enabled intrpts
VICIntEnClr = 0xffffffff; // disable all intrpts

// your ISR code here.

VICIntEnable = intrptSwap; // restore intrpts
VICVectAddr = 0; // acknowledge interrupt (must have this)
}//end i2c_si_isr() I'm using the lpc2129 and Keil Arm Tools and am new to both so sorry
if this is of no help.
--- In , "Ken" <anotheruglygeek@y...> wrote:
> I am having problems getting the I2C interrupt to work. I have
setup
> the VIC to enable the I2C interrupt (channel 9) in exactly the same
> way I have setup all the other interrupts (which work).
>
> I can see that the SI bit is getting set correctly - and I can use
> the I2C interface by polling this - but the ISR is not executing.
>
> Does the I2C interrupt have to be enabled anywhere else or is
setting
> up the VIC enough? The UART requires an enable bit to be set also
> but I cannot find an equivalent for I2C.
>
> The samples in the files section seem to also use polling. Any
help
> appreciated.
>
> Thanks!