Hello
i use i2c . in one method that we send slave address. i don't know what should i send. in my board i connect 24c16 to port A. what should i do. i think i need some explanation :( ?
this is my function :
unsigned char i2c_sendAddr(unsigned char addr)
{
//TWI transmit address in Master Transmit Mode
unsigned char STATUS;
if((addr & 0x01) == 0)
STATUS = MT_SLA_ACK;
else
STATUS = MR_SLA_ACK;
while(!(TWCR & (1<<TWINT))); //wait for TWINT flag set to indicate that SLA_W has been transmitted
if ((TWSR & STATUS_MASK) == STATUS)//check value of TWI status that ACK bit has been received
return(0);
else
return(1);
}
marjan2121 Guest
Posted: Tue Jan 27, 2009 5:24 am
i wanna to write on external EEPROM that is on 24C16. i should write 2 method read and write. i found that i should do this work with i2c ( i didn't have any knowledge about them) . i use code vision for implementing code. as you know in code vision , there is i2c.h and you can use this. and in manual can say that witch pins of portA (for example) is SDA and SCL.
i didn't use methods of i2c . i use another implementation of methods .
i am confuse now that how can connect with EEPROM . it should have a slave address ?
many question
can you help me.....
:(
Marjan
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Tue Jan 27, 2009 2:45 pm
Use the driver that comes with the CCS compiler. Here is the location:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum