Beschreiben nach einem Reset: ds1307_writereg(0,0x00110000b); // sekunden ds1307_writereg(1,0x01000000b); // minuten ds1307_writereg(2,0x00000011b); // stunden ds1307_writereg(3,0x00000101b); // wochentag ds1307_writereg(4,0x00001001b); // tag ds1307_writereg(5,0x00000010b); // monat ds1307_writereg(6,0x00001000b); // jahr Zyklisches Auslesen und Ausgabe auf Hyperterminal: uint8_t seconds,minutes,hours; uint8_t day, date, month, year; seconds = ds1307_readreg(0); minutes = ds1307_readreg(1); hours = ds1307_readreg(2); day = ds1307_readreg(3); date = ds1307_readreg(4); month = ds1307_readreg(5); year = ds1307_readreg(6); day = ds1307_readreg(3); date = ds1307_readreg(4); month = ds1307_readreg(5); year = ds1307_readreg(6); seconds &= ~128; uart_putc(((hours >> 4) & 0x01) + 0x30); uart_putc((hours & 0x0F) + 0x30); uart_putc(':'); uart_putc((minutes >> 4) + 0x30); uart_putc((minutes & 0x0F) + 0x30); uart_putc(':'); uart_putc((seconds >> 4) + 0x30); uart_putc((seconds & 0x0F) + 0x30); uart_puts(" -"); switch(day) { case 1: uart_puts("Montag, d."); break; case 2: uart_puts("Dienstag, d."); break; case 3: uart_puts("Mittwoch, d."); break; case 4: uart_puts("Donnerstag, d."); break; case 5: uart_puts("Freitag, d."); break; case 6: uart_puts("Samstag, d."); break; case 7: uart_puts("Sonntag, d."); break; } // tag uart_putc((day >> 4) + 0x30); uart_putc((day & 0x0F) + 0x30); uart_putc(':'); // monat uart_putc((month >> 4) + 0x30); uart_putc((month & 0x0F) + 0x30); uart_putc(':'); // jahr uart_putc((year >> 4) + 0x30); uart_putc((year & 0xF0) + 0x30); uart_putc(10); uart_putc(13);