DS3234 and SD card

Hi all,

I am currently using a RTC DS3234 together with microSD card to do data logger for sensor MPU6050. For data logging, the code I am using is the modification of lowlatencylogger from sdfat example. When I try to implement the RTC into this code, it just doesnt work and my complete code can be seen in the attached file.

What I need is simply show the real time for each data taken from the sensor. Since DS3234 is an SPI device, the cs pin for DS3234 I had selected 10 and for microSD card shield I had selected 8. The rest (MISO, MOSI, SCK) remain the same.

So can anyone pointed out where did I get wrong?

Back.ino (14.7 KB)

UserDataType.h (305 Bytes)

I doubt that you meant this!

  sd.begin(38400);

Pete

el_supremo:
I doubt that you meant this!

  sd.begin(38400);

Pete

Hi thanks for reply,

but i do not understand what you trying to say. Can you please elaborate?

Thank you.

An SD card doesn’t have a baud rate. So trying to initialize it at 38400 baud doesn’t make sense, especially when you correctly initialize it 15 lines further down:

 // initialize file system.
  if (!sd.begin(SD_CS_PIN, SPI_FULL_SPEED)) {

Delete the line with “sd.begin(38400);”.

Pete

el_supremo:
An SD card doesn't have a baud rate. So trying to initialize it at 38400 baud doesn't make sense, especially when you correctly initialize it 15 lines further down:

 // initialize file system.

if (!sd.begin(SD_CS_PIN, SPI_FULL_SPEED)) {




Delete the line with "sd.begin(38400);".

Pete

Hi,

Thank you so much for your explanation. I really had no idea about this. Thanks for the information.

:slight_smile: