hello everyone,
i am trying to interface at24c32 eeprom which is given with ds3231 rtc module.
here is my twi.c file
can anyone help with ds3231(rtc) + 24c32(eeprom)
i am trying to interface at24c32 eeprom which is given with ds3231 rtc module.
here is my twi.c file
Code (C):
- void Twi_Init()
- {
- TWSR=0x00;
- TWBR=0x46;
- TWCR=0x04;
- }
- void Twi_Start()
- {
- TWCR = ((1<<TWINT) | (1<<TWSTA) | (1<<TWEN));
- while (!(TWCR & (1<<TWINT)));
- }
- void Twi_Stop(void)
- {
- TWCR = ((1<< TWINT) | (1<<TWEN) | (1<<TWSTO));
- _delay_us(100) ;
- }
- void Twi_Write(uint8_t value)
- {
- TWDR = value ;
- TWCR = ((1<< TWINT) | (1<<TWEN));...