]>
Commit | Line | Data |
---|---|---|
1 | ------------------------------------------------------------------------------- | |
2 | Dallas DS1307 RTC Clock | |
3 | ------------------------------------------------------------------------------- | |
4 | ||
5 | This is a capture of data ouput from a Dallas DS1307 RTC module using: | |
6 | ||
7 | - hwclock -f /dev/rtc1 --systohc && { while true; hwclock -f /dev/rtc1; done } | |
8 | ||
9 | Details: | |
10 | - DS1307 datasheet: http://sparkfun.com/datasheets/Components/DS1307.pdf | |
11 | ||
12 | ||
13 | Logic analyzer setup | |
14 | -------------------- | |
15 | ||
16 | The logic analyzer used was Open Bench Logic Sniffer (at 200kHz): | |
17 | ||
18 | Probe DS1307 pin | |
19 | ------------------------- | |
20 | 0 SCL | |
21 | 1 SDA | |
22 | ||
23 | ||
24 | Data | |
25 | ---- | |
26 | ||
27 | This is what the decoded data should look like: | |
28 | ||
29 | - Setting the date/time: | |
30 | S Wr:0x68 A 0x16 A 0x35 A 0x18 A 0x01 A 0x10 A 0x03 A 0x13 A P | |
31 | ||
32 | - Reading the current date/time: | |
33 | S Wr:0x68 A 0x00 A Sr Rd:0x68 A 0x16 A 0x35 A 0x18 A 0x01 A 0x10 A | |
34 | 0x03 A 0x13 N P | |
35 | ||
36 | - The abbreviations used above: S = Start, Wr = Write, A = ACK, P = Stop, | |
37 | Sr = Repeated start, Rd = Read, N = NACK | |
38 | ||
39 | ||
40 | The sigrok command line used was: | |
41 | ||
42 | sigrok-cli --driver=ols:conn=/dev/ttyACM0 -d samplerate=200khz \ | |
43 | --samples=24576 -p 0=SCL,1=SDA --triggers SDA=0 -o <filename> | |
44 |