Read/write sd card
-
- Posts: 254
- http://meble-kuchenne.info.pl
- Joined: Tue Jul 13, 2021 1:53 pm
- Has thanked: 33 times
- Been thanked: 23 times
Read/write sd card
Hi. I've been battling with a sd card read write for a while now. The flowcode below has stripped out of a bigger project to try and figure out why it doesnt work in hardware but simulates. Its messy but thats because ive been stripping things out adding things etc. Can you give me apointer? The circuit also uses an RTC which is working and I have spent quite a while figuring out which PIC to use, settling onPIC16F1887 for its ram size and features. Any help pointers greatly appreciated. Flowcode has greatly improved development speed up to now but I need your help now
- Attachments
-
- SD card test.fcfx
- (21.62 KiB) Downloaded 154 times
-
- Valued Contributor
- Posts: 763
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
Re: Read/write sd card
Hi WingNut
Only SDHC or (microSDHC) card will work
32Giga is the largest that still works.
Set the Speed Prescaler to 64
Try to make a loop like this (name is fileSD ): regards
Stefan
Only SDHC or (microSDHC) card will work
32Giga is the largest that still works.
Set the Speed Prescaler to 64
Try to make a loop like this (name is fileSD ): regards
Stefan
Re: Read/write sd card
I tried as you suggested. Changed high speed prescaler value to 64 and made some changes to see what was being returned. So from the flowcode it displays 255 continuously as i wanted to give it as much time to initialise but to no avail
I'm using a 2GB micro sd card but i swapped for a 32GB sdhc card and same result. Checked all connections too
I'm using a 2GB micro sd card but i swapped for a 32GB sdhc card and same result. Checked all connections too
- Attachments
-
- SD card test.fcfx
- (22.07 KiB) Downloaded 149 times
-
- Valued Contributor
- Posts: 763
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
Re: Read/write sd card
Hi WingNut
Can you try to switch the SPI Mode to software mode?
regards
Stefan
Can you try to switch the SPI Mode to software mode?
regards
Stefan
- Attachments
-
- Software_2021-12-01_8-07-18.png (45.24 KiB) Viewed 3764 times
-
- Valued Contributor
- Posts: 763
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
Re: Read/write sd card
ok. What hardware do you have?
Here is my hardware as a sample how to connect a micro sd card to a PIC and set the port in FC.
Here is my hardware as a sample how to connect a micro sd card to a PIC and set the port in FC.
Re: Read/write sd card
This one connected as per the pinout on the device view
I have no pull up resistors or voltage dividers as the device has a regulator and level shifter
https://www.amazon.co.uk/gp/product/B07 ... UTF8&psc=1
I have no pull up resistors or voltage dividers as the device has a regulator and level shifter
https://www.amazon.co.uk/gp/product/B07 ... UTF8&psc=1
-
- Valued Contributor
- Posts: 763
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
Re: Read/write sd card
So your PIC and your SD-card are both on 3.3v or 5.0 Volt?
The wiring is here
https://mschoeffler.com/2017/02/22/how- ... duino-uno/
Can you check if your SD card is FAT32 format (Windos click on drive and choose propertis)
The wiring is here
https://mschoeffler.com/2017/02/22/how- ... duino-uno/
Can you check if your SD card is FAT32 format (Windos click on drive and choose propertis)