Activity Forums Questions & Troubleshooting Hardware SPI SD Card shield together with RTC

  • SPI SD Card shield together with RTC

     maggo updated 5 years, 4 months ago 2 Members · 6 Posts
  • maggo

    January 8, 2019 at 6:55 am


    I am using Controllino Maxi equiped with SPI SD Shield. If I use only SD shield to Log data ist works fine. But if I use it together with onboard RTC, the RTC delivers wrong values. I think one need to switch between the SPI slaves? Any example Code available?


    best regards

  • Lukas

    January 9, 2019 at 2:53 pm

    Hello, yes, you have to handle the Chip Select signals properly. It seems that the SD card stays enabled even if there is a communication with RTC. Then of course the data are corrupted.

    Example for the RTC is available in the CONTROLLINO library. In the Arduino IDE File->Examples->CONTROLLINO->Common->DemoRTC

    Or at GitHub

  • maggo

    January 10, 2019 at 8:00 pm

    Thanks Lukas,

    as I have to switch between the SPI Clients (RTC,SD,Ethernet) in the software I would need the PIN’s for chipSelect. I think the PIN for SD shall be 53. But in the PIN description there is no PIN Number for RTC/SS and ETH/SS??. Please help.



    P.S. To run only the RTC+Ethernet togehter is not a problem it works fine, without switching the SPI Clients

  • maggo

    January 13, 2019 at 2:58 pm

    Meanwhile I found the PIN numbers for SS RTC = 72 and SS ETH= 70, but I am still not able to switch between the SPI Clients. Also I have tried the functions: Controllino_SetRTCSS and Controllino_RTCSSInit without success. Can somebody provide a demo code?

  • Lukas

    January 15, 2019 at 11:07 am

    Hello Maggo,

    when you are using our CONTROLLINO library to access RTC and standard Ethernet library then the chipselect signals are handled automatically by the libraries. So you do not need to take care about them in your code.

    Maybe we can go one step back – which SD card shield are you using, please? Which signals are connected to CONTROLLINO?

    Could you provide us part of the code where you initialize and access the SD card?



  • maggo

    January 15, 2019 at 8:01 pm

    Hello Lukas,

    I got another hint from one expert telling me that the SD Module is not working for multiple SPI Clients. So I will change the module and I will let you know the results.


Viewing 1 - 6 of 6 replies

Log in to reply.

Original Post
0 of 0 posts June 2018