Re: DS1307 on rpi4B

風來散人 <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <CAJzLSnw5uuVhc9=HC5sCRv0nBzPXfbq_WVfYrmMg-h99hyRO-A@mail.gmail.com>
Hello Daniel.

Thank you for the suggestion. I created dtso file for my HW configuration
like this.

/dts-v1/;
/plugin/;

/ {
        compatible = "brcm,bcm2835";

        fragment@0 {
                target = <&i2c5>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";
                        ds1307: ds1307@68 {
                                compatible = "dallas,ds1307";
                                reg = <0x68>;
                                status = "okay";
                        };
                };
        };
        __overrides__ {
                ds1307 = <&ds1307>,"status";
        };
};

I modified config.txt to load this dtbo and add one more line to set GPIO
pins in [pi4]

gpio=12,13=a5,pu

This works fine and RTC starts working. One strange thing is that "gpioctl
-l -v" doesn't show correct pin setting somehow. I assumed there should be
PU on pin 12 and 13.

pin 12: 1       pin 12<>,
caps:<IN,OUT,PU,PD,INTRLL,INTRLH,INTRER,INTREF,INTREB>
pin 13: 1       pin 13<>,
caps:<IN,OUT,PU,PD,INTRLL,INTRLH,INTRER,INTREF,INTREB>

Best regards,
furaisanjin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.