??? 10/17/08 15:14 Read: times |
#159149 - Baby steps again - I2C, the return Responding to: ???'s previous message |
Hi,
I changed e2prom. I'm using 24C01. I downloaded Keil free edition. I could see the interrupt working in simulator. I put a single pin (P1.4) in low when the interrupt is called. I can see it in the Keil Simulator, but it doesn't work in the LPC. #define M24C01 0x50 // 0101 0000 void main(void) { P1M1 &= 0xEF; P1M1 |= 0x20; P1M2 &= 0xDF; P1M2 |= 0x10; P1 |= 0x10; i2c_init(0x00, 0); EA=1; while(1) { STA=1; i2c_transmit(M24C01); // send peripherical address while(STA);// wait trans. to be completed (device address) STO=1; } } I put the P1.4=0 near the ISR end: ... break; } // clear interrupt flag SI = 0; P1&= 0xEF; // 1110 1111 } // i2c_isr What's the problem ? Why the interrupt doesn't work ? The I2C interrupt is enable in i2c_init() and EA=1 in the main program. I don't know... Jorge |