SD connections query

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Francis
Registered User
Registered User
Posts: 314
Joined: Sun Mar 25, 2007 9:40 am
Location: Devon

SD connections query

Post by Francis » Thu Apr 03, 2008 8:56 am

Hi, my brain has fallen out.

I would be most grateful for a brief bit of advice re the SDLibrary / PIC-SD connections.

I made a board using an 18F2520 + SD card connector. The pinout was for hardware MSSP and I used PORTC.2 for the SD_CS line as per the defaults indicated in the 'help' example. It worked a blooming treat.

I needed more legs and memory, so moved over to an 18F4620. However, I needed PWM on C.2 so I used PORTD.4 for the SD_CS and set the #opt appropriately. Again hardware SPI and I've checked pin connections.
Sadly, the SD card won't initialise now. I've tried a couple of different 'speed' settings and I've tried a couple of SDs which check out fine PC (as FAT).

I was wondering; is there any reason why I can't use PortD.4 for the CS line? I haven't used/assigned D.4 anywhere else in my code.
(I am pretty certain that electrically all is OK . My PCB is made from the same CAD macro as my working version using the 18F2520. But I will re-check again for sillies and will confess even if I find something embarrassing.)

PS. I see Steve has modifed the SDlibrary so that any 'Initialise' failures return an error number. Are the error numbers/descriptions documented anywhere?

PPS. I remember some time ago, in another Forum, there was concern about License fees to Microsoft if using FAT. Any idea on the result? Should it worry me?

Post Reply