SD card woes. SOLVED!
Hi, I am using Kye's FAT 16/32 driver without RTC. Earlier I had this working with the Profiler Demo, by changing the pins accordingly.
Somehow, I cannot seem to get it to work with my (Allelectronics) socket. (I had it working at one time...)
It works on the WX board with the included socket, but when I wire it up to pins 8,9,10,11 (Same functions as default 22,23,24,25) it just doesn't seem to work. I have captured the logic from the default configuration which works correctly, and my socket, which does not, and have found nothing that seems to be different with the setup and signals. My socket has al the pullups. Here are shots of the logic captures
Default WX socket on pins 22,23,24,25:
and the Allelectronics socket on pins 8,9,10,11:
As you can see, I have cropped the logic to include part of the reset clocks at the beginning and until the card reacts differently
The same Profiler demo file is used for both and I change only the pin assignments..
Any ideas? I need this to work in a different situation where I must use this socket and pin assignments. I have replicated the problem on the WX board for discussion here.
Comments
Are you sure DO is getting through to the Propeller? Because that looks like it isn't getting the response from the init command and thus just keeps trying until it times out.
Wuerful,
Good idea!
I repeated the test, after verifying continuity on the wires & breadboard. This time I picked DO right off the chip:
Strangely, the logic is a bit different, as I can see some additional activity on DO but it still ultimately fails...
I also repeated the test in the final app (All soldered, but checked continuity anyway..) same result. Perhaps there has been some variation and I just didn't see it yet.
It should not matter, as this works using the WX socket, but I am using FlexProp.. in Linux..
Also, what's going on with that clock pin? It shouldn't be going while CS is high. No idea how that'd happen. Can you, like, post some code?
Wuerful!
Thanks Much!
I did an experiment with a flip on a breadboard and proved to myself that it works on pins 8,9,10,11. Repeated the test on the WX, and it worked, I guess I'll never know exactly why it didn't before... Breadboards.. Checked my final board again and all had continuity.. and then didn't.. yep it was DO, and it was ok when there was lots of pressure on the board from the test lead, and not so much with less pressure. It was a cracked trace!
Tough little bug..
Thanks again!
I will post the code anyway, because the clock bug is concerning, This is straight up from the Git OBEX with Kye's FAT16/32 code
Now, you might want to try my prop OS. Link in my signature.
You will need to redefine the SD pins and ensure the clock is set to 80MHz as I usually compile to 104MHz.
Cluso..
Intriguing.. I will take a much closer look at prop OS. The current project is almost done, so no time on this trip.. but the next one...
On the other front, after the first initialization, the clock/CS behaves correctly after the initialization? phase. I seem to half remember some discussion that a large number of clocks with a certain configuration of other pins ensured that the card was put into a known state?? Maybe that is the reason for the hundreds of clocks before the first assertion of CS?
I posted a block diagram for talking to the SD Card on the P2 forum. Probably a link in my RetroBlade2 - Now you have it thread.