Re: MMC multiple block write problem. (What is "BUSY" in the diagram i provided?)
Obviously the best situation would be to get a microcontroller with much more RAM. Some Atmel microcontrollers have much more RAM than PIC chips. But you still might be able to do it with the 16F877.
Most other applications that access MMC/SD are probably reading the partition table, the FAT, and the directory into memory and then accessing it. And writing it back to the card when modified. You certainly can't do that, because of the limited RAM.
But you will be able to at least read the root directory and get the file's starting sector without using much RAM. After that it will be tricky. Because of the way FAT works, one entry refers to another entry that probably won't be in sequential order...this would require reading a sector and throwing away everything up to the part you need (because you have to read an entire sector of 512 bytes).
So I think what you have to do is find the file on the card and read all of the file's FAT locations into an array. This will limit the maximum file size to something like 25 sectors?...Or whatever space your PIC can afford. (I'm assuming each sector number takes up 4 bytes). Then move through the array, getting each sector from the card and sending it to the PWM.
I hope you can do it. My application was a data logger that created its own file of a fixed size on the MMC, which made the FAT handling much easier. I didn't allow files to be put onto the MMC from a computer. Instead, I erased the root directory each time the data logger was started and created a "new" file in the same location.
The only 18F I have used that has enough RAM is the 18F2455, but it is only a 28-pin chip. I haven't used any 40-pin 18F chips. And, actually, the only chips I've used with MMC/SD are: 16F628, 16F88, and 16F886.
If you can do this it will be a great achievement, because everyone else will tell you that you can't do anything on a MMC with a PIC that has only 256 bytes of RAM!
Mike