Hi all, I am using KEIL UVISION for my application. I am trying to enhance I2C module of the same. I have initialized it in Master transmitter mode. When I first time transmit START command by setting STA in I2C register at that time my program execution jumps to ISR for I2C. But after clearing SI flag it does not go back to ISR for I2C when SI flag is set again...
Can anybody suggest where I may be wrong? Thanks Harisingh Rajput
"I am trying to enhance I2C module of the same"
There is no such thing!
uVision is applicable to all the chips supported by all Keil toolsets:
http://www.keil.com/dd/ http://www.keil.com/product/
So there is no such things as "the" I2C module!
You must have code for a specific processor - or, at least, a specific range of processors.
The question is meaningless without knowing what processor(s) you are talking about.
Also, if it is (based on) a piece of published code, then give a link to that code.
Any reason why you not only forgot to mention processor, but also forgot to set the architecture in the forum thread? You really think I2C interrupt handling is a generic concept identically applicable to any processor architecture?
LPC2148.
I have checked for whether interrupt is disabled or not. through JTAG. It is showing that interrupt remains enabled but somehow code execution does not go to that ISR. Do I need to re enable interrups again. If it is working at first but not after an interrupt occurs it has to be in the interrupt service routine. Something isn't being set correctly. WHAT?
I think "the same" refers here to his application, in which case there is definitly a file containing the I²C routines and hence a .o module.
Concerning your problem it's hard to tell, there is a *lot* of things that can go wrong. I have use the I²C on a LPC1768 and after a quick browse in the LPC2148 user manual, the programming should be fairly identical so you can try to write you code based on it's I²C driver.
ics.nxp.com/.../lpc17xx.cmsis.driver.library.zip
Good help Loup Balleyguier. Many many thanks to you.
"I have use the I²C on a LPC1768 and after a quick browse in the LPC2148 user manual, the programming should be fairly identical so you can try to write you code based on its I²C driver."
Why waste time messing with stuff for a different processor when NXP provide this stuff specifically for the processor in question:
www.nxp.com/.../LPC2141_42_44_46_48.html
www.standardics.nxp.com/.../code.bundle.lpc213x.lpc214x.uvision.zip
There is a large interrupt controller difference between the LPC2148 and the 1768.
Was wondering what KOX1'37 was about in Harisingh Harisingh Rajputs summary.
Then noticed that on my keyboard K is left of L, O is left of P, on to 7 is left of 8.
Is it some sort of encryption or has he just got his keyboard a little too far to the right?
Doubtlessly using code directly written for the good processor is better than adapting the driverd of a somewhat related one. I was just trying to give help with the little experience I have on the matter. This is after all an end-user forum as you say so oftenly.
Fair enough, and since the problem seems to be regarding interrupts, looking at the LPC17XX dirvers won't be very useful. But still, the I²C hardware and registers are the same on the two controller so it cannot do any harm to have a quick peek on the drivers code.
Yes, it certainly can!
There may be some subtle - or not so subtle - difference(s) that could totally send you down the wrong track!
If a user only gets one interrupt and no more, then the VIC is probably not acknowledged. The I2C device may be ready to issue more interrupts, but the VIC has locked the interrupt until acknowledged.