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 support@ccsinfo.com

write sector problem on 128m mmc(it work on 32m)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nader



Joined: 29 Aug 2004
Posts: 12

View user's profile Send private message Send e-mail

write sector problem on 128m mmc(it work on 32m)
PostPosted: Thu Mar 31, 2005 1:29 am     Reply with quote

hi,
i use a function for write a sector to a mmc card.
on 32mb Nokia card it work but in the 128mb Nokia card it didn't.
it never free from busy flag.
could some one please guide me?
here is the code:
unsigned char MMCWriteSector(unsigned long lba, char *s)
{
unsigned int i;
MMCCommand(24, (lba<<9));
if (MMCGet() == 0xff)
return 1;

for(i = 0 ; i < 100 ; i++)
SpiByte(0xff);

SpiByte(0xfe); // Send Start Byte

SpiByte(0xff);
SpiByte(0xff);
SpiByte(0xff); /* Read "data response byte" */

i = 0xffff;
while ((SpiByte(0xff) == 0x00) && (--i)); /* wait for write finish */
if (i == 0)
return 2; // Error
MMC_CS = 1;
return 0;
}
i recieve on both card first 0xe5 that mean accept the data & when i must recieve 0xff mean free from busy
but on 128mb card always stay 0x00.
why?
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Mar 31, 2005 5:15 am     Reply with quote

DON'T DOUBLE POST !!!

I placed a reply in your original thread.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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