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

MicroSD can't read individual byte address

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



Joined: 29 Sep 2012
Posts: 8

View user's profile Send private message

MicroSD can't read individual byte address
PostPosted: Wed Oct 31, 2012 11:14 am     Reply with quote

I got a terrible problem in MicroSD interface with pic18F4620.

When I try to read each byte address in microSD, example my code
Code:

 mmc_readblock(0,data_fat.buff);

A data_fat.buff[0] return value: EB

But when I read next address, it still same value: EB

Code:

 mmc_readblock(1,data_fat.buff);

A data_fat.buff[0] still return value: EB

And when I set next 512 byte address, it return right value.
Code:

 mmc_readblock(512,data_fat.buff);


Anyone got any experience with this problem please help me, I so headache with this problem.
Thanks !
temtronic



Joined: 01 Jul 2010
Posts: 9164
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Oct 31, 2012 12:07 pm     Reply with quote

Without more information it is really hard to tell you where your problem is.
Hardware issues include mismatched voltages(5V PIC, 3V sd card),incorrect level translations,improper layout,etc.
Software issues include initialization routines,addressing,card select,timing,etc.
2 or 3 lines of code isn't anything solid of anyone to really comment on where the problem is.

This all assumes you've read/written to the card on a PC with KNOWN data.

The more info you supply( schematic,size of card(make/mfr/etc.),main program the better(quicker) we can help.

hth
jay
tidushuu



Joined: 29 Sep 2012
Posts: 8

View user's profile Send private message

Reply
PostPosted: Wed Oct 31, 2012 12:35 pm     Reply with quote

Thanks for reply.
About my hardware, its correct because a few weeks ago I could run with my SD card wtihout any problems. Now I use micro SD, I can still get mmc_init and reset work well, but when I read individual byte address, I can't get value I need.
I think microSD always return back 512 byte value address, so I must change whole my code for this if I can't solve this problem.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 31, 2012 2:01 pm     Reply with quote

Could it be the first card you tested was standard capacity and the microSD card is SHDC?
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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