Continue to Site

Welcome to

Welcome to our site! is an international Electronics 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.

[Moved] SD Memory with AT89s8252

Not open for further replies.


Newbie level 4
May 22, 2015
Reaction score
Trophy points
Activity points
I wants to interface sandisk 4gb sd memory with at89s8252 mcu using spi.
so, any body can help me for initialization process with sample code.

You can use petit Fatfs library for SD Card.

can you help me with sample code?

Just check the petit Fatfs website. I thik it has an example of using the library.

If you use PIC or AVR then I can help you. 89S52 diesn't have hardware SPI. You have to write software SPI routines. Instead can you use PIC or AVR. I can give you FAT16 or FAT32 code for PIC or AVR.

Sorry, AT89S52 has hardware SPI. You have to write SPI initialization code for your chip.

I use mikroC PRO 8051 Compiler. For you 8252 chip there is hardware SPI library in mikroC. I will see if Fatfs can be implemented for your chip.
Last edited:

Yes, I can use PIC. So, pls help me with sample code

If you use PIC then I will write a FAT32 code but using mikroC FAT32 library for reading and writing files and for opening directories. You have to use PIC18F46K22. Is this ok for you. There will be sno code for the FAT32 library as it is a pre compiled library but it will work in hardware. You can't test FAT32 in Proteus.

It,s Ok send me the code by which I can test

can i know, what is the use of CD PIN of SD memory in spi mode.

Not open for further replies.

Part and Inventory Search

Welcome to