chipKIT® Development Platform

Inspired by Arduino™

PICtail Daughter Board for MMC and SD cards

Created Thu, 22 May 2014 18:36:17 +0000 by plafi092


plafi092

Thu, 22 May 2014 18:36:17 +0000

Alright, so I had a few of these PICtail SD card boards lying around from previous work with an Explorer 16 Development kit and I've been trying to get it wired to my uC32 with some jumper wires.

After 2 days of fiddling with both the SD library (MPIDE 2012-09-03) I still have been unable to get the CardInfo sketch to work.

I've tried switching SDI and SDO on the PICtail board (seeing as it seems to be reversed in the schematics vs. the pinouts of an SD card, my only thought was that it was describing the pins from the microcontroller side and not so much for the SD card).

My wires are about 10" long which has me worried due to some of the things I've read online about SCK needing a clean signal but without access to a scope it's a little difficult to check what is actually going on with my signals.

Any help would be greatly appreciated. Thanks in advance.


majenko

Fri, 23 May 2014 17:02:46 +0000

"MPIDE 2012-09-03"

Holy cow, that's ancient!

Get a new version!!!


plafi092

Fri, 23 May 2014 17:23:22 +0000

Haha, I did just to check if things had changed in the SD library. Have there been any modifications? I just glanced and didn't see any apparent ones.


Jacob Christ

Fri, 23 May 2014 18:09:42 +0000

I think the ability to open more than one file at a time was added near or maybe after that version.


plafi092

Fri, 23 May 2014 18:40:55 +0000

Ah ok, well I'd settle for just opening one at this point.

Maybe someone can shed some light on this one. Below is the schematic for the PICtail board I'm trying to use.

http://ww1.microchip.com/downloads/en/DeviceDoc/DS-51583b.pdf

From my understanding of it, I've connected VPIC to +5V, GND to GND, RB3 to the pin labeled 10 on the uC32 (I've tried both JP4 positions for RD4 and RG9 with pinMode(10, OUTPUT) and pinMode(44, OUTPUT) simultaneously in my sketch), RC3 connected to pin labeled 13, and finally RC4 and RC5 to pins labeled 11 and 12 (and also tried switching the last two). My uC32 is also set to be in MASTER mode via JP5 and JP7. In the demo sketchs for the SD library it mentions that pin 10 has to be set as an output, but this just got me confused as to whether or not this applied to the PIC since pin 10 can be either connected to SPI2 or something else.

The first 3 jumpers (JP1, JP2 and JP3) on the PICtail board are all set in the upper position (pins 1-2).

I don't think the problem is with the PICtail board since I've tried 3 different ones. Although I did notice that when grounding pin 12 on the card edge connector (at least I think it's this pin I've been ground) which is labeled CS', that the LED D1 did not light up. It does however light up when I ground RB3 which is also supposedly connected to the same pin.


plafi092

Fri, 23 May 2014 19:20:42 +0000

Quick update. Here is a clear image of the board for reference.

And also, for the schematic of the card edge connector, top and bottom are also apparently switched (at least from an intuitive notion of top being where the SD card connector is attached). Not sure if this helps any.


majenko

Fri, 23 May 2014 23:01:51 +0000

Is the PICtail doing 5v->3.3V level shifting for using it with 5V MCUs? If so, that will most probably break when running with a 3.3V MCU.


plafi092

Fri, 23 May 2014 23:12:40 +0000

I believe it is. There's an MCP1253 on the board which takes 5V in and supposedly outputs a 3.3V signal which is used to power the input signal buffers and the pull up resistors of the SD card. The output signals from the board however are kept at 5V but I believe the chipKIT pins are 5V tolerant which shouldn't be a problem.


majenko

Sat, 24 May 2014 08:17:23 +0000

Just looking at the schematic. Looks like they've done the level translation properly (not like some people), so it should work fine from both 3.3V and 5V signals.

Have you tested continuity between the two suspect CS pins? They look like they should connect together, yes.

You could also try bypassing all the gubbins on the board completely and wiring direct to the SPI test points on the board - that will be a direct connection to the card then.


plafi092

Wed, 28 May 2014 18:54:51 +0000

Yes, it appears that all the CS pins are connected. I also went into the SD library to slow down the port toggling for the SCK and SDO to make sure signals were actually working since all I had is an LED to test signals. I did think of bypassing those but as you said, I checked continuity for all and it seemed fine.

What I noticed between libraries though, SD and MAL, is that clock rates for initialization seems to be maxed out in SD but throttled down in MAL. At 80Mhz, doesn't bit banging go much more than 400khz which is supposedly the safe limit described in MAL? I'm guessing that the generated clock isn't so clean either at around 10-20Mhz. Also, I mention again that my jumpers are quite long. Could this have any significant effect on my control signals?