farhanauu
Junior Member level 1
- Joined
- Aug 25, 2013
- Messages
- 18
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 129
im new to micro controller programming
i have written a code that stores data to eeprom and get back data to blink leds accordingly but its not working on proteus.
Kindly help me i have to submit this project this weekend.
thanks
my code is
sbit Soft_I2C_Scl at RA0_bit; //i2c clock line
sbit Soft_I2C_Sda at RA1_bit; //ic2 data line
sbit Soft_I2C_Scl_Direction at TRISA0_bit;
sbit Soft_I2C_Sda_Direction at TRISA1_bit;
unsigned char read,i;
unsigned short data_,L ;
unsigned short error;
void main ()
{
TRISB=0;
//TRISA.RA0=0;
//TRISA.RA1=0;
PORTA.RA0=1;
PORTA.RA1=1;
TRISA.RA3=1;
if(PORTA.RA3=1){
PORTB=5;
for(i=0;i<255;i++)
{
Soft_I2C_Init();
Soft_I2C_Start();
Soft_I2C_write(i);
Soft_I2C_Write(i);
Soft_I2C_stop();}}
i=0;
while(1)
{
for(i=0;i<255;i++)
{
Soft_I2C_Init();
Soft_I2C_start();
Soft_I2C_Write(i);
L =Soft_I2C_Read(1);
//if(L){
PORTB=L;
//PORTB.RB7=0;
Soft_I2C_Stop();
//lay_ms(500);
}
}
}
and proteus file is
i have written a code that stores data to eeprom and get back data to blink leds accordingly but its not working on proteus.
Kindly help me i have to submit this project this weekend.
thanks
my code is
sbit Soft_I2C_Scl at RA0_bit; //i2c clock line
sbit Soft_I2C_Sda at RA1_bit; //ic2 data line
sbit Soft_I2C_Scl_Direction at TRISA0_bit;
sbit Soft_I2C_Sda_Direction at TRISA1_bit;
unsigned char read,i;
unsigned short data_,L ;
unsigned short error;
void main ()
{
TRISB=0;
//TRISA.RA0=0;
//TRISA.RA1=0;
PORTA.RA0=1;
PORTA.RA1=1;
TRISA.RA3=1;
if(PORTA.RA3=1){
PORTB=5;
for(i=0;i<255;i++)
{
Soft_I2C_Init();
Soft_I2C_Start();
Soft_I2C_write(i);
Soft_I2C_Write(i);
Soft_I2C_stop();}}
i=0;
while(1)
{
for(i=0;i<255;i++)
{
Soft_I2C_Init();
Soft_I2C_start();
Soft_I2C_Write(i);
L =Soft_I2C_Read(1);
//if(L){
PORTB=L;
//PORTB.RB7=0;
Soft_I2C_Stop();
//lay_ms(500);
}
}
}
and proteus file is