Activity › Forums › Questions & Troubleshooting › Hardware › SPI SD Card shield together with RTC
-
SPI SD Card shield together with RTC
-
Hello, 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?
Thanks
best regards
-
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 https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/blob/master/Common/DemoRTC/DemoRTC.ino
-
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.
regards
Maggo
P.S. To run only the RTC+Ethernet togehter is not a problem it works fine, without switching the SPI Clients
-
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? -
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?
Thanks,
Lukas
-
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.
regards
Log in to reply.