summaryrefslogtreecommitdiff
path: root/i2c/rtc_dallas_ds1307/README
blob: 20edc7ebca0f778c3aab2f2beb309812ffc667c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
-------------------------------------------------------------------------------
Dallas DS1307 RTC Clock
-------------------------------------------------------------------------------

This is a capture of data ouput from a Dallas DS1307 RTC module using:

 - hwclock -f /dev/rtc1 --systohc && { while true; hwclock -f /dev/rtc1; done }

Details:
 - DS1307 datasheet: http://sparkfun.com/datasheets/Components/DS1307.pdf


A. Logic analyzer setup
-----------------------

The logic analyzer used was Open Bench Logic Sniffer (at 200kHz):

 Probe          DS1307 pin
 -------------------------
 0              SCL
 1              SDA


rtc_ds1307_200khz_*.sr
----------------------

This is what the decoded data should look like:

 - Setting the date/time:
   S Wr:0x68 A 0x16 A 0x35 A 0x18 A 0x01 A 0x10 A 0x03 A 0x13 A P

 - Reading the current date/time:
   S Wr:0x68 A 0x00 A Sr Rd:0x68 A 0x16 A 0x35 A 0x18 A 0x01 A 0x10 A
   0x03 A 0x13 N P

 - The abbreviations used above: S = Start, Wr = Write, A = ACK, P = Stop,
   Sr = Repeated start, Rd = Read, N = NACK


The sigrok command line used was:

  sigrok-cli --driver=ols:conn=/dev/ttyACM0 -d samplerate=200khz \
             --samples=24576 -p 0=SCL,1=SDA --triggers SDA=0 -o <filename>


B. Logic analyzer setup
-----------------------

The logic analyzer used is a Saleae Logic clone (at 500kHz):

 Probe          DS1307 pin
 -------------------------
 D0 (CH1)       SCL
 D1 (CH2)       SDA

The sigrok 0.7.1 command line used:

sigrok-cli --driver fx2lafw --channels D0=CLK,D1=DATA \
           --config samplerate=500khz:captureratio=1 --samples 1000 \
           --triggers CLK=1,DATA=f --output-file <filename>


rtc_ds1307_500khz_sqw32khz_mode12h_pm.sr
----------------------------------------

The file provides reading of time keeping registers as well as control register
of the RTC chip, which was setup to 12-hours mode, time with PM flag, and
square wave frequency 32768 Hz before in order to demonstrate bugfixes
in the following GitHub pull request for libsigrokdecode
(merged as b3f6033022006c8f4ee88a70155f3571bee1a2ca):

  https://github.com/sigrokproject/libsigrokdecode/pull/10