Forum breadcrumbs - You are here:ForumGeneral: Report BugsProblem Read DS1307 AVR
You need to log in to create posts and topics.

Problem Read DS1307 AVR

Hello

I have problem with read ds1307 using atmel studio avr(using Ardunio is ok).

when I load hex file to simulate on atmega 16, microcontroller wait for read data in ds1307 (while (!(TWCR & (1<<TWINT)));)

and program not exit from while(), the code is correct, because i test with proteus and work correctly

but on simulide 1.0.0, 1.1.0 not work ( while (!(TWCR & (1<<TWINT))) )

TWCR = (1<<TWSTA)|(1<<TWEN)|(1<<TWINT);/* Enable TWI, generate start condition and clear interrupt flag */
while (!(TWCR & (1<<TWINT)));  /* Wait until TWI finish its current job (start condition) */
 
thanks.

Hi can you share your circuit and code to test it?

Hello

yes I can.