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 lpc2000@yahoogroups.com, "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!Message
Re: I2C interrupt
2004-08-30 by Mel
Attachments
- No local attachments were found for this message.