Discussion in "8051 Discussion Forum" started by    Help    Dec 8, 2008.
Sat Dec 13 2008, 07:32 pm
#11
Dear Fren,

Thank for your advice. Now i know basically how the MMCInit work and how the Command Frame timing diagram work already.




May i know what is the next step should i do? I have tried use proteus to do the tesing look like alway fail at...MMC Not detected.

if (MMCGet() != 1)
{
   CE  = 1;
   return -1;  // MMC Not deteced
 } 


Please advice..

Thank you.


[ Edited Sat Dec 13 2008, 08:23 pm ]
Sat Dec 13 2008, 08:01 pm
#12
I am not sure if MMC works in Proteus, never seen anyone using it.

do one more thing.. see if you can try with controller having onchip SPI, I know clock is not a problem but still it may be a culprit.
Sat Dec 13 2008, 08:57 pm
#13
Dear Fren,

I will try to look AT89S8253 as you suggested. I have search other uC which have buid in SPI:
AT89S8252
AT89S53
This 2 uC is it can use? Is it sufficient for the SD/MMC?

Thank you.

Mon Dec 15 2008, 05:39 pm
#14
yes.. they are.. in case of writing, make use of code buffer of 512MB, and while reaeding, directly send read bytes to serial window so u need not to save them. Coz right now testing is more important.

Phillips RD2 - P89V51RD2's datasheet says it has SPI, but some say it doesnt work.. only thing is it has got sufficient ram for usage. anyways.. you do ur testing with any of the above controller.
Wed Dec 17 2008, 10:34 am
#15
Dear Fren,

I have found some supplier. Currently they don't have this special IC and some say may be have to wait another 4-5 week's then only they will order the IC or may be no...

This morning i have successed to tested out the result. Only the
int MMCReadSector(unsigned long lba, char *s){}
and
int MMCWriteSector(unsigned long lba, char *s){}

don't know how to use it. May i know lba is what parrameter? What should i pass the variable into the function?

After this 2 function, What's the next step..I can do 1st? Please advice..

Thank you,.
Thu Dec 18 2008, 02:43 am
#16
so can we conclude that MMC works in proteus?

functions MMCReadSector and MMCWriteSector needs two arguments:
1. lba - sector number to read/write
2. s - Buffer from where data is to be written or read from.

internally in these functions, first lba is converted to internal memory address. and MMC read command is sent to card, after that 512 bytes of data is read/written.

Will be waiting for progress great work
Thu Dec 18 2008, 08:42 am
#17
Ya, mmc works in protues..

I just simply pass lba = 0x0010, s[6]="Hello". The MMCReadSector no data is read out is because the for loop function is copy the data 512 times..

The s[] buffer size only have 6 but when read/write that time the for loop is looping 512 times. That's why cause the MMCReadSector no data is read out. We don't have much internal RAM in C52 or C8253 as well, how we can overcome this case? May i know why we need to do 512 times when Read and Write the MMC/SD?

Please advice..
Thank you


[ Edited Thu Dec 18 2008, 10:36 am ]
Fri Dec 19 2008, 01:22 am
#18
s6 cannot be less than 512 bytes. as minimum read/write block is of 512 bytes which is default for any MMC/SD card.

I told you to create a buffer using keyword code like this

unsigned char code buffer[512] = "your data";


and send bytes directly while reading to serial port instead of storing them. so this way its not required to save them on ram. waiting for reply.
Fri Dec 19 2008, 08:26 am
#19
Dear Fren,

Thank you, I thought i know what you have mean already.

So, what shall we do for the next progress,. Is it can go for FAT system?

Thank you.
Sat Dec 20 2008, 01:15 am
#20
yeah try that.. also there is a good news for u.. I think AT89C51RD2 is available in proteus. so you can make use of onchip SPI of RD2 and try out your code again. waiting for your input.. also more ram is there in RD2 so reading and writing wont be a problem.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am