ar. How to read an SD card with PIC32MZ EC Sarter Kit with Starter Kit I/O Expansion board?

Connect micro USB 2.0 port to the PC and plug in a suitable external DC power supply with 9 V up to 15 V to Starter Kit I/O Expansion board. I used a standard 12 V=, 1 A AC to DC converter. The additional power supply is needed for proper PICtail board and SD card operation.

I tested an SD card with 8 GB and a large number of photos. Reads and writes worked correctly and the data transfer rate was about 1 MB/s (1 mega byte per second). Yes, it is also an alternative way transferring your photos to a PC, but it is certainly not the fastest one! A laptop or a mini PC with an inbuilt SD card can transfer files at least twice as fast.

NOTE: If you don't connect an external DC power supply to the expansion board, the starter kit might not be able to start correctly and it would repeatedly reset itself as it was in my case.

If you have problems reprogramming your PIC32MZ EC Starter Kit, click here to read how to revive a stuck starter kit.

ALSO READ:

- PIC32MZ2048ECx100 - 100-pin PIM basic USB circuit

- How to program PIC32MZ EC Starter Kit with PICkit3?

- Microsoft Visual Basic.NET support for PIC32MX250F128B, PIC32MX270F256B, PIC32MZ2048ECH100 and PIC32MZ2048ECH144 (PIC32MZ EC Starter Kit)

Set PICtail daughter board jumpers for USB operation as described in Microchip DS51583B document.

Assemble PIC32MZ EC Starter Kit, 168 pin to 132 pin adapter and Starter Kit expansion board and plug SD card PICtail board into the first port, so it gets over the expansion board edge as you can see on the photo.

Recompile the example with the new settings and download it to PIC32MZ2048ECH144 on PIC32MZ EC Starter Kit. Disconnect the starter kit and insert your SD card into PICtail board.

Next, expand Harmony Framework Configuration\Drivers\SPI\SPI Driver Instance 0 and change SPI Module ID to SPI_ID_1. Open Pin Diagram and map SCK1 to RD1, SDI1 to RD14 and SDO1 to RD10. If you don't do this right, the starter kit won't be able to access your SD card.

First, a different board support package (BSP) has to be enabled. If your configuration is not listed as in our case, choose PIC32MZ Starter Kit configuration.

Mass storage device SD card example (MSD SD card example) is not as hard to adapt for PIC32MZ EC Sarter Kit with Starter Kit I/O Expansion board and SD card PICtail board as one might think. The main difference is that the original Harmony v1.07.01 MSD SD card example (<harmony installation path>\v1_07_01\apps\usb\device\msd_sdcard) is preset for PC32MZ EC Starter Kit with Multimedia Expansion Board (MEB) II and WVGA glass.

Click on the photo to enlarge it.