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.

Register Log in

how can i connect pic16f877a to 512mb micro SD memory card?

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
is it possible to connect micro sd memory card directly to pic16f877a ?
Can i play mp3 or amr or wav using this ?
If any one have some information about this ,pls help me.

---------- Post added at 15:50 ---------- Previous post was at 15:45 ----------

and also,I would like to know how to store and take data to and from memory card using PIC16F877A .
 

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,068
Helped
273
Reputation
554
Reaction score
248
Trophy points
1,343
Location
Japan
Activity points
10,597
Hello!
The circuit is quite easy. See attachment.
So you need 4 wires, 3 for the SPI bus and one for chip select (use a general purpose IO port).
The drawing was for MSP430, but any processor would do it. And if you don't have a SPI port,
you can make one by bit banging.
What kind of source code do you want? I think you can find everything on the net.

Dora.
 

Attachments

incomplete_jerin

Advanced Member level 2
Joined
Jun 4, 2010
Messages
551
Helped
97
Reputation
208
Reaction score
93
Trophy points
1,308
Location
INDIA
Activity points
3,912
Thanx dora......
What did you mean by "bit banging"?
Regards,
Jerin.
 

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,068
Helped
273
Reputation
554
Reaction score
248
Trophy points
1,343
Location
Japan
Activity points
10,597
Hello

Bit banging simply means using a general purpose I/O port for SPI (or I2C
or other serial bus) emulation. Here is an example of SPI implementation in
pseudo code (part of it only, example for sending a byte in SPI).

We will use the following conventions:
MISO_LOW (Master In Slave Out Low). This is the input from the CPU point
of view, from device to processor.
MISO_HIGH : same but high
MOSI_LOW and MOSI_HIGH (same as above but with Master Out Slave In).
This is the output, from processor to device.
Similarily, we'll have CS_LOW and CS_HIGH for select or deselect,
and CLK_LOW, CLK_HIGH for the clock.

Usually, when you want to send a byte or multiple bytes to a SPI device, you
have first to select it (usually drive CS low). Therefore CS_LOW in our pseudo
code. Then you have to send every bit, in many case MSB first.
And then we will clock evey bit from the CPU.

We will also define the following array:

Code:
const uint8 BIT8[] = {
    0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
};
Sending a byte MSB first will be:

Code:
void BitBangSendByte(uint8 val) {
    uint8 i;
    CS_LOW();
    for(i = 0 ; i < 8 ; ++i) {
        if(val & BIT8[i]) MOSI_HIGH();
        else MOSI_LOW();
        CLK_LOW();
        CLK_HIGH();
    }
    CS_HIGH();
}
With this method, you can communicate with a SPI device even if the
processor you are using doesn't have a SPI bus.

Dora
 

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
Hello!
The circuit is quite easy. See attachment.
So you need 4 wires, 3 for the SPI bus and one for chip select (use a general purpose IO port).
The drawing was for MSP430, but any processor would do it. And if you don't have a SPI port,
you can make one by bit banging.
What kind of source code do you want? I think you can find everything on the net.

Dora.
can i connect a PIC16F877A to MMC? I am using HIGH TECH C compiler. Could u help me....
 

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,068
Helped
273
Reputation
554
Reaction score
248
Trophy points
1,343
Location
Japan
Activity points
10,597
Hello!

can i connect a PIC16F877A to MMC? I am using HIGH TECH C compiler. Could u help me....
I have never used a PIC. However, if I had to, I would verify that:

- The supply power is compatible;
- It has a SPI bus or at least 4 unused GPIO pins to emulate SPI.

Then MMC or SD will connect without any trouble.

Dora.
 

incomplete_jerin

Advanced Member level 2
Joined
Jun 4, 2010
Messages
551
Helped
97
Reputation
208
Reaction score
93
Trophy points
1,308
Location
INDIA
Activity points
3,912
So we get audio support by using this decoder rite?That means we can play the audio files via PIC?
Regards,
Jerin.
 

Luciferus

Member level 1
Joined
Oct 5, 2010
Messages
34
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Location
Mexico
Activity points
1,483
Look in Google for "homemade mp3 player pic"... or something like that and it will help.

I've found something:
020 - EchoMp3 v1.4 - MMC/SD Card MP3 Player

And a book that might be helpful:
SD Card Projects Using the PIC Microcontroller - Elsevier, there's a preview in Google Books.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top