Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Why MMC reading speed is less compared to writing speed?

Status
Not open for further replies.

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
750
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,049
Why the mmc reading speed is less compared to writing speed? I tried to write adc outputs to MMC in real time using a PIC16F877A. ADC input was the head phone output of my PC. I played a song in pc and recorded it to MMC via above mentioned method...
Now when i read the MMC , i could not hear the song(PWM output) due to the low reading speed.
So what i did is, i had introduced a 1ms delay in every byte write to MMC. Then i could just hear the recorded song even though its quality very very bad...So i understood that writing speed is very high compared to reading speed and if i introduce a delay of 1ms in writing loop, the speed is equalized . But its a big delay and it reduces the audio quality...

Now i think the time gap between each byte read is more compared to byte write..
Why it is like this?
 
Last edited:

upand_at_them

Full Member level 2
Joined
Feb 26, 2010
Messages
131
Helped
21
Reputation
42
Reaction score
21
Trophy points
1,298
Location
Pennsylvania, U.S.
Activity points
1,942
I think you're going to run into a problem because of the limited RAM in that PIC. Ideally you'd want to be reading one sector (512 byes) while a routine is PWM'ing the previous sector.

Also, there's probably the same issue with writing. You'd want to be writing the cached sector to the MMC while sampling the ADC.

Are you running the PIC at 20MHz and using the built-in SPI peripheral? And are you sending the data to the MMC as fast as you can?...because the built-in SPI allows setting the speed.

Vinod, are you trying to write and read at the same time? I assumed you were recording the full audio to MMC, and then read it back.
 

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
750
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,049
My problem is solved...i unknowingly introduced a delay of 1ms in spi read. Now i removed it and i equalized the reading and writing time...Now the audio quality increased increased a lot!!!
Yes i am using the inbuild SPI of 877a. Actually i am not using the RAM as a buffer and in this case i cant. So i am reading the MMC and after every byte read i shift it to PWM register. Similarly in case of writing also...

Any way ones again thanks @upand_at_them for providing an excellent link which describes the writing and reading procedure of MMC.
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top