Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

SD Card Driver Library For AVR MicroControllers. It is tested in CodeVisionAVR IDE and ATMEGA32A

License

Notifications You must be signed in to change notification settings

melecir/SD-Card-Driver-Library-For-AVR-MicroControllers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Note: This small library had written by me several years ago (2012) when I was working on my university project ( Wave Audio Player With AVR Microcontrollers and SD Card) and I just wanted to have it here for memory :)

SD Card Driver Library For AVR MicroControllers

It is tested in CodeVisionAVR IDE with ATMEGA32A

How to Use

Include mega32.h and spi.h headers and then this header sd_lib.h

For example our microcontroller is ATmega32

#include <mega32.h>

#include <spi.h>

#include "sd_lib.h"

Init SPI Registers

SPCR=0x50;

SPSR=0x01;

Init SD Card

It returns 0 If it is initiated correctly

unsigned char  sd_init(void);

Finally use read_sd and read_sd functions to read data.

unsigned char  read_sd(unsigned long int  sector,unsigned char* buffer);

unsigned char  write_sd(unsigned long int sector,unsigned char* buffer);

Input is SD Card sector number and output is sector size buffer array.

About

SD Card Driver Library For AVR MicroControllers. It is tested in CodeVisionAVR IDE and ATMEGA32A

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages