dave@huckleberrycove.ca
Member
I designed a data logger with a Teensy 3.2. It senses a signal on the A/D, and measures acceleration with a SparkFun ADXL435 on I2C. It also has a SF RTC DS3234 and a SF SD card (DEV-13743) on SPI. I built two prototypes and they work correctly. Now I have produced a PCB and find I have a conflict between the RTC and the SD card.
When I built the first version I had a similar conflict and noticed that if I touched the RTC board it would sometimes work. I discovered that a 0.1 uF cap between GND and the RTC CS made it work consistently. But why? The PCB version still has the conflict between the RTC and SD, even with the 0.1 uF.
I wrote a little test sketch which reads the RTC and prints the time 5 times per second.
(When I tried to attach the code, I lost my post and had to type it all again. I will post without the code and then try to send it again.)
When I run my logger without an SD card inserted, it works and I can set and read the time. If I insert an SD card, it does not set the time correctly but it all runs, even writes data to the card. So the wiring must be correct.
The RTC test holds the SD CS high so it should be “off”. When I run the RTC test, it shows the correct time if no SD card is inserted. If I insert a card, the time output becomes totally wrong. If I remove the card, the time is correct again (even without a restart). I make a scope trigger pulse on PIO 4. I have looked at MISO, MOSI and SCLK with and without the card and see no difference.
Any ideas? I do not like to fix things with a random capacitor here or there.
Dave Heffler
When I built the first version I had a similar conflict and noticed that if I touched the RTC board it would sometimes work. I discovered that a 0.1 uF cap between GND and the RTC CS made it work consistently. But why? The PCB version still has the conflict between the RTC and SD, even with the 0.1 uF.
I wrote a little test sketch which reads the RTC and prints the time 5 times per second.
(When I tried to attach the code, I lost my post and had to type it all again. I will post without the code and then try to send it again.)
When I run my logger without an SD card inserted, it works and I can set and read the time. If I insert an SD card, it does not set the time correctly but it all runs, even writes data to the card. So the wiring must be correct.
The RTC test holds the SD CS high so it should be “off”. When I run the RTC test, it shows the correct time if no SD card is inserted. If I insert a card, the time output becomes totally wrong. If I remove the card, the time is correct again (even without a restart). I make a scope trigger pulse on PIO 4. I have looked at MISO, MOSI and SCLK with and without the card and see no difference.
Any ideas? I do not like to fix things with a random capacitor here or there.
Dave Heffler