I have been working with the RCM3700 for some time and now is the time for my first question in this forum. So please - be patiant - I am new in this forum !!!
My goal is to use a SD Card with 1G memory together with the RCM3700, but I don’t know where to tell the software, that I have connected the SD card to the “Serial C” line ? Could comeone help me with this ?
Information:
I have looked into some samples of code and tested the Fmt_Device.C and FAT_SHELL.C without the SD Card connected and it work fine. I can write and read data form a file. I guess that these programs are communicationg with the serial flash that is a part of the RCM3700. Now I want to ommunicate with a SD card using SPI sommunication.
[QUOTE=japping;4200]I have been working with the RCM3700 for some time and now is the time for my first question in this forum. So please - be patiant - I am new in this forum !!!
My goal is to use a SD Card with 1G memory together with the RCM3700, but I don’t know where to tell the software, that I have connected the SD card to the “Serial C” line ? Could comeone help me with this ?
Information:
I have looked into some samples of code and tested the Fmt_Device.C and FAT_SHELL.C without the SD Card connected and it work fine. I can write and read data form a file. I guess that these programs are communicationg with the serial flash that is a part of the RCM3700. Now I want to ommunicate with a SD card using SPI sommunication.[/quote]
SD librarys works with a few Rabbit modules (for example RCM3900) by default. You need make a few changes in the library files. You should change SD card CS control and CD (Card detect) pins in \lib\sdflash\sdflash.lib. In my case CS (chip select) was PORTD pin 4:
/////////////////////////////////My code start///////////////////////////////////
/* #define SD_CS_PORT GOCR #define SD_CS_PORT_DRSHADOW &GOCRShadow #define SD_CS_PORT_DDR 0 #define SD_CS_PORT_FR 0 #define SD_CS_PORT_FRSHADOW NULL #define SD_CS_PORT_DDRSHADOW NULL #define SD_CS_PORT_DCR 0 #define SD_CS_PORT_DCRSHADOW NULL #define SD_CS_PIN 0 #define SD_CS_PORT_OD 1 // Use OD for disable state on GOCR
*/ #define SD_CS_PORT PFDR #define SD_CS_PORT_DRSHADOW &PFDRShadow #define SD_CS_PORT_DDR PFDDR #define SD_CS_PORT_FR PFFR #define SD_CS_PORT_FRSHADOW &PFFRShadow #define SD_CS_PORT_DDRSHADOW &PFDDRShadow #define SD_CS_PORT_DCR PFDCR #define SD_CS_PORT_DCRSHADOW &PFDCRShadow #define SD_CS_PIN 4 #define SD_CS_PORT_OD 0 // Use OD for disable state on GOCR //Cia OpenDrain valdymas
//////////////////////////////My code end///////////////////////////////////
I didn’t use SD card detect pin, so I made follow:
After this You have to make a few changes in file \lib\file_system\fat_config.lib. I wrote about these chages in the topic “SD card FAT16 with RCM3100”. Replace RCM3100 in to RCM3700.