From 05645cd8c22b6e316a3b5b33c79009e9b54b3bac Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Fri, 28 Jul 2006 06:00:56 +0000 Subject: [PATCH] Changed SD OCR to a larger voltage range, hopefully fixing problems with a few cards. --- source/disc_io/io_m3sd.c | 2 +- source/disc_io/io_scsd.c | 2 +- source/disc_io/io_sd_common.h | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/disc_io/io_m3sd.c b/source/disc_io/io_m3sd.c index f1253a7..5ea117b 100644 --- a/source/disc_io/io_m3sd.c +++ b/source/disc_io/io_m3sd.c @@ -256,7 +256,7 @@ static bool _M3SD_initCard (void) { return false; } - _M3SD_sendCommand (SD_APP_OP_COND, 3<<16); + _M3SD_sendCommand (SD_APP_OP_COND, SD_OCR_VALUE); if ((_M3SD_getResponse_R3 (responseBuffer)) && ((responseBuffer[1] & 0x80) != 0)) { // Card is ready to receive commands now break; diff --git a/source/disc_io/io_scsd.c b/source/disc_io/io_scsd.c index 13648a8..f4891a5 100644 --- a/source/disc_io/io_scsd.c +++ b/source/disc_io/io_scsd.c @@ -208,7 +208,7 @@ static bool _SCSD_initCard (void) { return false; } - _SCSD_sendCommand (SD_APP_OP_COND, 3<<16); + _SCSD_sendCommand (SD_APP_OP_COND, SD_OCR_VALUE); if ((_SCSD_getResponse_R3 (responseBuffer)) && ((responseBuffer[1] & 0x80) != 0)) { // Card is ready to receive commands now break; diff --git a/source/disc_io/io_sd_common.h b/source/disc_io/io_sd_common.h index 0d17257..3ed5afb 100644 --- a/source/disc_io/io_sd_common.h +++ b/source/disc_io/io_sd_common.h @@ -32,6 +32,9 @@ 2006-07-11 - Chishm * Original release + + 2006-07-28 - Chishm + * Changed voltage range that the SD card can use */ #ifndef IO_SD_COMMON_H @@ -59,6 +62,9 @@ #define SET_BUS_WIDTH 6 #define SD_APP_OP_COND 41 +/* OCR (Operating Conditions Register) send value */ +//#define SD_OCR_VALUE 0x00030000 /* 2.8V to 3.0V */ +#define SD_OCR_VALUE 0x003F8000 /* 2.7V to 3.4V */ /* SD Data repsonses */ #define SD_CARD_BUSY 0xff