0

I've designed a custom circuit board using an ATmega328P, which I intend to use for writing data to an SD card via a reader/writer module. When I initially tested the SD card reader/writer with an Arduino Uno, it worked flawlessly. However, running the same code on my ATmega328P setup results in the SD card reader failing to initialize.

I've attached my current schematic for reference. Initially, I included a logic level converter for the signal pins but removed it after realizing that the Arduino Uno didn’t require one. During troubleshooting, I manually checked the continuity between each SD card reader pin and the corresponding ATmega328P pin (for instance, confirming that MISO connects to pin 12, or PB4 on the ATmega328P when it’s plugged into the Arduino).

I've verified that all connections on the circuit board are correct and have continuity. Using a multimeter, I've also confirmed that the SD card writer is receiving 5V both when connected to the Arduino (where it works) and to my custom circuit board (where it doesn't). I’m confused about the difference between the Arduino and my circuit board. I’ve attached an image showing how I connected the SD card reader/writer to the Arduino. The image has a slightly different SD card reader/writer, but the pin layout remains identical (SCK and CLK are the same).

Arduino connection to SD card writer Improved schematic circuit circuit circuit

13
  • I assume you're programming the ATmega in the uno, and then moving it across to this custom PCB? Consider adding a blinking pin to your code just so you can be 100% sure that the ATmega is running properly. Also, consider using labels rather than long wires, it'll help make your schematics easier to read.
    – LordTeddy
    Commented Aug 22 at 15:35
  • This schematic doesn't need labels to be readable, though. It needs to replace the ground wire with ground symbols, the 3.3V wire with power symbols , rotate J1 180 degrees, and move J7 to be below J5, and J8 to be below J6, and flip and put J10 above J9.
    – MrGerber
    Commented Aug 22 at 15:43
  • Your schematic is not very readable. What is the "external clock" connected to? Have you verified that the ATMega runs at all?
    – StarCat
    Commented Aug 22 at 16:12
  • The schematic shown is just a simplification to isolate the problem. I have a six pin to USB adapter to program the ATmega, and I've tested programs on it previously. I can upload code and use the board completely fine, and only the SD card writer doesn't work. As for my bad schematic, I don't really know how to do a better one. I'm using KiCad, and I can't find the correct symbol for the external clock or know how to do labels. Each of the external clock pins (J5 and J6) are connected to the leads of a 16 MHz external clock. I'll edit the original post and try to make it clearer. Commented Aug 22 at 16:31
  • 1
    the SD card adapter on the photo doesn't have a logic level conversion and should be powered with 3.3 V.. and there is no SD card in it.
    – Juraj
    Commented Aug 23 at 13:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.