Olimex Support Forum

DUINO => DUINOMITE => Topic started by: lecat on January 23, 2013, 05:28:12 PM

Title: Duinomite E Mega config sd card SPI3 mplab
Post by: lecat on January 23, 2013, 05:28:12 PM
just bought a mega E, I can not configure the MPLAB code for the SD card works.
someone would have a code

thank you
Title: Re: Duinomite E Mega config sd card SPI3 mplab
Post by: LubOlimex on January 24, 2013, 09:28:35 AM
Hey there lecat,

There is MPLAB project for the SD card test available here: https://www.olimex.com/Products/Duino/Duinomite/DUINOMITE-eMEGA/resources/PIC32-DuinoMite_eMega-LAN.zip (https://www.olimex.com/Products/Duino/Duinomite/DUINOMITE-eMEGA/resources/PIC32-DuinoMite_eMega-LAN.zip). Did you test with it?

Note that this is a stand-alone test, not an implementation in the MMBasic.

Best regards,
Lub/OLIMEX
Title: Re: Duinomite E Mega config sd card SPI3 mplab
Post by: lecat on January 24, 2013, 11:44:56 AM
hello

Yes, I tested it but I do not understand lines in the hardware?

    // Tris pins for SCK/SDI/SDO lines

    // Description: The TRIS bit for the SCK pin
    #define SPICLOCK            TRISDbits.TRISD1
    // Description: The TRIS bit for the SDI pin
    #define SPIIN               TRISDbits.TRISD2
    // Description: The TRIS bit for the SDO pin
    #define SPIOUT              TRISDbits.TRISD3


I put after le schematic


    // Tris pins for SCK/SDI/SDO lines

    // Description: The TRIS bit for the SCK pin
    #define SPICLOCK            TRISDbits.TRISD15
    // Description: The TRIS bit for the SDI pin
    #define SPIIN               TRISFbits.TRISF2
    // Description: The TRIS bit for the SDO pin
    #define SPIOUT              TRISFbits.TRISF5

but I can't write on the card, but else works

you would have a code that works?

merci i'm french