Thanks for answers.
Still this doesn't seem to be running with my PIC (that is tested and working).
In the example sdcard_fat_single_disk
, if i do a simple code:
int main ( void )
//__XC_UART = 1; // Code is configured to use UART1
/* Initialize all MPLAB Harmony modules, including application(s). */
while ( true )
/* Maintain state machines of all polled MPLAB Harmony modules. */
//SYS_Tasks ( );
/* Execution should not come here during normal operation */
return ( EXIT_FAILURE );
The LED doesn't turn on.
On Pin Settings
i did the following:
Pin N Pin ID Voltage Name
6 RC1 5V APP_SUCCESS_LED
8 RC3 5V APP_FAILURE_LED
38 RA1 5V BSP_LED_2 (I have this pin unconnected)
41 RB12 BSP_SWITCH_12 (I have this pin unconnected)
42 RB13 BSP_SWITCH_13 (I have this pin unconnected)
50 RF5 SDO1 (DAT0)
51 RF3 SDI1 (CMD)
67 RA15 U1TX (connected to my ftdi)
70 RD10 SCK1 (CLK)
87 RF0 5V BSP_SWITCH_CD (I have this pin unconnected)
88 RF1 5V BSP_SWITCH_WP (I have this pin unconnected)
The SDCS (chip select) i suppose that is done through the Drivers configuration in:
Option -> Drivers -> SD Card -> Use SD Card Driver? ->
Chip Select Port: PORT_CHANNEL_F
Chip select Port Bit: PORT_BIT_POS_12
I don't know about Enable Write Protect Check?
if this needs to be configured, in:
Option -> Drivers -> SD Card -> Use SD Card Driver? -> Enable Write Protect Check?
The example should run straightfoward? But not even a LED turns on with either BSP_LEDOn(APP_SUCCESS_LED);
is it my fault?
Btw, in BSP Configuration,
i guess i need to put Custom, as i build my own PCB.
As i user internal oscillator, i tried changing some configurations in DEVCFG1
Oscillator Selection Bits: FRCPLL EDIT:
The example now runs, it seems that on BSP Custom option needs to be selected or nothing works.
My app is getting stuck at:
if(SYS_FS_Mount("/dev/mmcblka1", "/mnt/myDrive", FAT, 0, NULL) != 0)
/* The disk could not be mounted. Try
* mounting again untill success
err = SYS_FS_Error();
printf("e%c \r\n",err); //Gives error 3, (3) The physical drive cannot work
appData.state = APP_MOUNT_DISK;
/* Mount was successful. Unmount the disk, for testing. */
appData.state = APP_UNMOUNT_DISK;
After looking at the oscilloscope i see an oscillating signal on SDCS
and its High on SDDI
post edited by Nmaster88 - 2019/07/01 09:32:59