Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interfacing SD card with P89V664

Status
Not open for further replies.

mehtadhaval

New Member
Hello everyone,
I want to interface SD card with P89V664 (8051 core, 2kb RAM, 64kb flash, SPI and I2C). I want to store data in the SD card and read it back from SD card using this controller.

Can anyone help me in this matter ?

Also, before I interface that, I want to know what is the access time of the SD card, because I need fast data rates...
 
In the above links, they are using the SD card in SD mode, but, I wanted to use it in SPI mode because it is comparatively easy to use.
 
If you're reading the data back through the controller you don't have to bother with the FAT file system, which can be a big bloody mess. You will still have to read and write in blocks of 512 bytes, though.

Find the SD/MMC card spec on the web. It will detail the sequence for putting the card into SPI mode. In brief, it goes like this:
1. Set CS high
2. Clock a number of times.
3. Set CS low.
4. Send CMD0 with a valid CRC (0x95).
5. Get a valid response (0x01).
6. Try sending CMD1 a number of times until you get a valid response (0x00) or a timeout. The commands from here on don't need a valid CRC.
7. Set CS high and you're now in SPI mode.
 
@upand_at_them and Ian Rogers....
Thanx for your help....
and, as you have done it, can you tell me the access time for reading a single byte (if possible) or a block of 512 bytes... ?
The controller I am using can provide upto 20Mhz as SPI clock....
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top