CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

mmcsd always read value 00
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
msa



Joined: 07 Apr 2010
Posts: 15

View user's profile Send private message

PostPosted: Sun Dec 19, 2010 7:47 am     Reply with quote

Hi all

I would like to thank my colleagues who help me in solving my problems


Schematic :
------------


Code:

 #include <18F2550.h>

#FUSES NOWDT                       //No Watch Dog Timer
#FUSES INTRC_IO                       //Internal RC Osc
#FUSES NOPROTECT                   //Code not protected from reading
#FUSES DEBUG                     // Debug mode for ICD
#FUSES NOLVP                       //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOMCLR                        //Master Clear pin enabled
#FUSES NOPUT
#use delay(clock=8M)


#use rs232(baud=9600, xmit=PIN_C6,Errors)

#use fast_io(b)
#use fast_io(c)
#define MMCSD_PIN_SCL        PIN_B1 //o
#define MMCSD_PIN_SDI        PIN_B0 //i
#define MMCSD_PIN_SDO       PIN_C7 //o
#define MMCSD_PIN_SELECT   PIN_A0 //o

#include <mmcsd.c>

#include <input.c>

void main(void)
{

 BYTE value;
 int32 address;

setup_oscillator(OSC_8MHZ);

   printf("\r\n\n Wellcome \r\n\n");
   
   if (mmcsd_init())
   {
      printf("Could not init the MMC/SD!!!!");
      while(TRUE);
   }
 
   for(address = 0x00000000; address <= 0x0000010; address++)
   {
      mmcsd_read_byte(address, &value) ;
      
          printf("Add --> %lX , HexVal --> %X, AsciiVal--> %c\n\r", address, value, value) ;

   }
   
   do {
 
   } while (TRUE);   
}


Data
Code:

 Wellcome

Add --> 00000000 , HexVal --> EB, AsciiVal--> ë
Add --> 00000001 , HexVal --> 3C, AsciiVal--> <
Add --> 00000002 , HexVal --> 90, AsciiVal--> 
Add --> 00000003 , HexVal --> 4D, AsciiVal--> M
Add --> 00000004 , HexVal --> 53, AsciiVal--> S
Add --> 00000005 , HexVal --> 44, AsciiVal--> D
Add --> 00000006 , HexVal --> 4F, AsciiVal--> O
Add --> 00000007 , HexVal --> 53, AsciiVal--> S
Add --> 00000008 , HexVal --> 35, AsciiVal--> 5
Add --> 00000009 , HexVal --> 2E, AsciiVal--> .
Add --> 0000000A , HexVal --> 30, AsciiVal--> 0
Add --> 0000000B , HexVal --> 00, AsciiVal-->
Add --> 0000000C , HexVal --> 02, AsciiVal--> 
Add --> 0000000D , HexVal --> 04, AsciiVal--> 
Add --> 0000000E , HexVal --> 06, AsciiVal--> 
Add --> 0000000F , HexVal --> 00, AsciiVal-->
Add --> 00000010 , HexVal --> 02, AsciiVal--> 
jacqueskleynhans



Joined: 10 Apr 2008
Posts: 109
Location: Cape Town, South Africa

View user's profile Send private message

Software SPI
PostPosted: Tue Mar 08, 2011 1:38 pm     Reply with quote

Can this example be used with an software spi interface ??

Regards

Jacques
_________________
"THE ONLY EASY DAY WAS YESTERDAY"
jacqueskleynhans



Joined: 10 Apr 2008
Posts: 109
Location: Cape Town, South Africa

View user's profile Send private message

PostPosted: Wed Mar 09, 2011 7:54 am     Reply with quote

cool got it to work Smile
_________________
"THE ONLY EASY DAY WAS YESTERDAY"
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group