sdcard on otg with uecide and chipkit core

Started by steve45, February 16, 2015, 09:52:31 AM

Previous topic - Next topic

steve45

Hi everybody,
I'm trying to get an sdcard access running using uecide and the chipkit core. I've already included code to switch jtag off.
Select pin is 8.
But nothing works, always getting error on SD.begin?
Any ideas?
Does anybody else use the otg with the uce ide?
Br, steve

bubele

Hello Steve,

just see this thread, a bit late...

I too use the Olimex_OTG with Chipkit mpide and trapped into that recently while trying to access the SDCARD on the OTG board.
There is a mismatch in the Board_data.c Pin mapping for this Baord.
D8 aka D8_MMC_#SS is twisted with D9, so using D8 is acting on D9.
I did not checked about others, but simply modified it to get the SDCARD working.

pc@c-20po:/opt/chipKIT/hardware/pic32/variants/Olimex_PIC32_Pinguino_OTG$ diff Board_Data.c.ORIG Board_Data.c
127,128c127,128
<       _IOPORT_PB,     //  8  RB14 D8  AN14/#U2RTS/PMALH/PMA1/RB14
<       _IOPORT_PB,     //  9  RB15 D9  AN15/OCFB/PMALL/PMA0/CN12/RB15
---
>       _IOPORT_PB,     //  8  RB13 D8  (pc) RB14 D8  AN14/#U2RTS/PMALH/PMA1/RB14
>       _IOPORT_PB,     //  9  RB14 D9  (pc) RB15 D9  AN15/OCFB/PMALL/PMA0/CN12/RB15
179,180c179,182
<       _BV( 14 ) ,     //  8  RB14 D8
<       _BV( 15 ) ,     //  9  RB15 D9
---
>       // (pc)_BV( 14 ) ,      //  8  RB14 D8
>       _BV( 13 ) ,     //  8  RB13 D8
>       // (pc)_BV( 15 ) ,      //  9  RB15 D9
>       _BV( 14 ) ,     //  9  RB14 D9
209a212

now using D8 is working as expected, accessing SDCARD using D8 as SlaveSelect works too.

best regards
Peter ;-)