I do what you have suggested, starts to study the elm-chan project
example.
I got the circuit that he uses in a image that goes with the example
code.
Analising the only difference that i found in the circuit of my board is
that the MCI POWER pin in his board is changed to P0.10 as a GPIO pin.
In my board this pin is connect to MCI_POWER pin (P0.21).
The only reference that I found to pin P0.10 in the code is in mci.c:
#define SOCKPORT FIO0PIN1 /* Socket contact port */
#define SOCKINS 0x04 /* Card detect switch (bit2) */
#define SOCKWP 0 /* Write protect switch (none) */
What I understand is that the interruption change the stat analising
this pin to know if there is a card connected to the socket.
In my board, the same pin, is connected to P0.21, that should be:
#define SOCKPORT FIO0PIN2
#define SOCKINS 0x20
#define SOCKWP 0
but with this change still don't work, i got an error verifing if there
is a Card conected to the socket, returns 3 (STA_NOINIT|STA_NODISK).
The same value is returned if the card is or isn't on the board.
Sure there is not the correctly form to verify if there is a Card
connected to the board. How can I verify if there is a card connected to
a board to pass this state check?
I also tried to force the Stat variable to be 0 (all OK) to pass this
step of verification. The verification pass, identify the card as SDC
ver1 or SDC ver2 correctly (I tryed both), but in this part of mci.c
goto di_fail (error):
mci.c / inside disk_initialize function:
do { /* Wait while card is busy state (use ACMD41 or CMD1) */
/* This loop will take a time. Insert wai_tsk(1) here for multitask
envilonment. */
if (!Timer[0]) goto di_fail;
} while (!send_cmd(cmd, 0x00FF8000, 1, resp) || !(resp[0] &
0x80000000));
The response received goto a error.
Can anyone help-me to solve this or indicating where can I be missing?