Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4922

can anyone help with ds3231(rtc) + 24c32(eeprom)

$
0
0
hello everyone,

i am trying to interface at24c32 eeprom which is given with ds3231 rtc module.

here is my twi.c file
Code (C):
  1.  
  2. void Twi_Init()
  3. {
  4.     TWSR=0x00;
  5.     TWBR=0x46;
  6.     TWCR=0x04;
  7. }
  8.  
  9. void Twi_Start()
  10. {
  11.     TWCR = ((1<<TWINT) | (1<<TWSTA) | (1<<TWEN));
  12.     while (!(TWCR & (1<<TWINT)));  
  13. }
  14.  
  15.  
  16. void Twi_Stop(void)
  17. {
  18.     TWCR = ((1<< TWINT) | (1<<TWEN) | (1<<TWSTO));
  19.     _delay_us(100) ;
  20. }
  21.  
  22.  
  23. void Twi_Write(uint8_t value)
  24. {
  25.        TWDR = value ;
  26.        TWCR = ((1<< TWINT) | (1<<TWEN));...
can anyone help with ds3231(rtc) + 24c32(eeprom)

Viewing all articles
Browse latest Browse all 4922

Trending Articles