sundar11
Member level 1
- Joined
- Apr 16, 2014
- Messages
- 41
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 8
- Activity points
- 272
Only two arm7 devices are available in the bus. is we can isolate the controllers. i am checking that..
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hi shruv
Thanks for your help.. i gone through the code, its really useful.. in slave what states are you checking, i am checking 0x60 and 0x80. any suggestions..
#include <lpc214x.h>
#include "type.h"
#include "LCD_16x2.h"
void I2C_Inti(void);
__irq void I2C_ISR(void);
int c,i;
char k;
char buf[8];
int main()
{
LCD_Init();
PINSEL0&=0xFFFFFF0F;
PINSEL0|=0x00000050;// using i2c0
VICVectCntl0 = 0x20 | 9;
VICIntEnable |= (1<<9);
VICVectAddr0 = (unsigned long)I2C_ISR;
I2C_Inti();
Display_String("slave");
LCD_Command(0x80);
}
void I2C_Inti(void)
{
I2C0ADR=0x01;
I2C0CONCLR= 0xff;
I2C0CONSET=0x40;
I2C0CONSET=0x04;
}
__irq void I2C_ISR()
{
switch(I2C0STAT)
{
case 0x70 : Display_String("g");
I2C0CONSET|=0x04; //AA bit set
I2C0CONCLR=0x08;
break;
case 0x90 :
for(i=0; i<9; i++)
{
Display_String("r");
buf[i]=I2C0DAT; //data received and stored safely
} Display_Decimal(buf[i]);
I2C0CONCLR=0x08;
break;
case 0xa0 :Display_String("p");
I2C0CONCLR=0x08;
break;
default:Display_String("n");
I2C0CONCLR=0x08;
break;
}
VICVectAddr=0x00;
}
HI shruv
is it not possible to assign a particular address to a microcontroller, whether i need to use the general call bit.