|
|
View previous topic :: View next topic |
Author |
Message |
tidushuu
Joined: 29 Sep 2012 Posts: 8
|
MicroSD can't read individual byte address |
Posted: Wed Oct 31, 2012 11:14 am |
|
|
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: 9244 Location: Greensville,Ontario
|
|
Posted: Wed Oct 31, 2012 12:07 pm |
|
|
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
|
Reply |
Posted: Wed Oct 31, 2012 12:35 pm |
|
|
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: 1635 Location: Perth, Australia
|
|
Posted: Wed Oct 31, 2012 2:01 pm |
|
|
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!! |
|
|
|
|
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
|