I'm trying to make a weather station which can log data to an SD card. All went well until I tried to add a timestamp to the datalog file. I have cut the program to the bone and find that it functions fine provided:
1.) The SD Card is not in the socket...... OR
2.) Remove the reference to ReadTimeDate() at line 168 with the SD Card present.
Some details, I'm using Arduino 1.6.5, the project uses an Arduino Pro Mini (5v, 16MHz), DS3234 RTC chip, the SD Card and DS3234 are both using a 3.3v local regulated supply, additionally the SD Card CS, SCK, and MOSI lines are buffered with a CD4050 chip. I have scoped the CS lines using 2-probes to verify that they are not active (low) at the same time.
additionally the SD Card CS, SCK, and MOSI lines are buffered with a CD4050 chip
Why the buffer chip? A bidirectional level converter would make more sense, as would using a 3.3V Arduino. Please post a hand-drawn wiring diagram.
We recommend to get all the parts working individually before putting them together. Have you separately been able to read and write to the RTC without problems?
SD cards have been known to Not release the MISO line. Try adding one gate of a buffer like 74HC125 on MISO coming back from the SD, with it's OE/ driven by CS going to the SD card.