We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i am writing the code on i2c communication but it's not communicating betwwen the atmega169p and blr24f(external eepeom) the codw shown below #include<ioavr.h> #include<stdio.h> #include <intrinsics.h> #include <TWI_Master.h> //void write(unsigned char dadr,unsigned char mloc,unsigned char data); void main(void) { unsigned int data=0x02,read; //unsigned int j=000000000; PORTE=(1<<5);//sda; PORTE=(1<<6);//scl; USICR=0XA3;//USICR |=(1<<5);START+TWO WIRE MODE USISR=0X9F;//USICR &=~(1<<4);
USICR|=(1<<7);//startbit=1 USIDR=0X0A;//device address //USIDR=(j&0xFF);//lowerbyte USIDR=0000; USIDR=data; USICR=(1<<5);//stop bit
/* USICR|=(1<<7);//startbit=1 USIDR=0X0B;//device address //USIDR=(j&0xFF);//lowerbyte USIDR=0002; //USICR|=(1<<7);//startbit=1 read=USIDR; USICR=(1<<5);//stop bit */ while(1);
1. The purpose of this forum is clearly stated:
"The Keil Discussion Forum is an open forum where you may post questions and comments about Keil products." http://www.keil.com/forum/
Your post has nothing to do with Keil products.
2. The instructions for posting source code are clearly stated: www.danlhenry.com/.../keil_code.png
You haven't followed them, and don't even seem to have noticed that your posted code is illegible.
Is it any surprise, then, that your code doesn't work?