View previous topic :: View next topic |
Author |
Message |
toni
Joined: 26 Jan 2013 Posts: 9
|
Storing sound in wav format in sd |
Posted: Sun Jun 02, 2013 11:32 am |
|
|
Hi all,
As part of my project, i have to store an analog sound signal on SD card in wav file format. Please can anyone point me in the right direction?
THANK YOU |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sun Jun 02, 2013 11:51 am |
|
|
got code?
do you know the data rate and bit depth for your sound storage?
and how you are going to ADC/DAC the stream ?
my first tip is that this is NOT a task for Pic16 or pic18 part
as buffer RAM for SD card read/write is in short supply on these parts |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9173 Location: Greensville,Ontario
|
|
Posted: Sun Jun 02, 2013 12:29 pm |
|
|
duration of sound ?
you do know that 5volt PICs and 3volt SD cards need level translators ?
tried Google yet?
gotta be a zillion 'hits' about this project,you ain't the first !
since this is 'part' of your project , what else is there to do ? You'll need a mighty big PIC,perhaps an external RAM for buffering though it is do-able on a onePICsolution providing datarate is low,duration small and you're great at cutting code.
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
toni
Joined: 26 Jan 2013 Posts: 9
|
|
Posted: Sun Jun 02, 2013 1:37 pm |
|
|
Ok. I am actually a newbie in programming. However, yes I know i would need level translators. So i was thinking of using LF pic, maybe pic18lf6620. I came across the ex_fat.c example in ccs, but i don't really know how to use that for wav files. For the ram, i said its only a part of the project, but its only the part that actually involves a microcontroller. ADC samples the signal and the pic stores it in a sd. I'm really sorry if i sound a bit ignorant. I just need some direction. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9173 Location: Greensville,Ontario
|
|
Posted: Sun Jun 02, 2013 2:09 pm |
|
|
Well this project is actually a HUGE undertaking for a novice programmer!
You've got a LOT to learn so how much time do you have? weeks,months,years?
first..You've got to decide which PIC will work best for you.I'd spend 3 or 4 days with google to see what others have done...
2nd..SD cards are a real PAIN. NONE seem compatible,size matters(<2GB for the driver..),interfacing can be 'fun'.
3rd..There's a 'learning curve' you'll have to overcome.Start with the simple '1Hz blinking LED',then 'Hello World' to a PC terminal program.
With those done, you've at least confirmed you can sucessfully program a PIC.
4th..hardware..the 'bigger' the PIC the better.You'll need lots of RAM and code space.How will you interface the ADC and DAC section to 'record' and plyaback the audio? Or do you just record and save,transferring to a PC to playback?(That will cut code by about 1/4 !)
5th..Why SD card? If you've got an extra $30 I'd buy a 'Vinculum' module. It easily interfaces ANY USB flash drive, runs on 5 volts,simple 'DOSlike' commands.It's the option I chose 2 years ago.
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
toni
Joined: 26 Jan 2013 Posts: 9
|
|
Posted: Sun Jun 02, 2013 3:08 pm |
|
|
Thank you for your time. I am a newbie, but I've actually done some projects over the months this year on pic. This particular one is a school project. I already programmed pic 18f4520 to sample input signals, store them in an eeprom and play back using the pic pwm. However, my supervisor wants me to go further and do something that can be accessible with a PC. That's why i thought of the option of the sd card. I dont know if there are other less expensive and less strenous option. Thank you
P.S I know pic 18f4520 doesnt have enough ram for fat file system, that's why I'm thinking of pic18lf4550 or pic18lf6620. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9173 Location: Greensville,Ontario
|
|
Posted: Sun Jun 02, 2013 3:14 pm |
|
|
Well, I'd split the project into 3 pieces.
1st job...take a known .WAV file, transmit to PIC via serial port and play using the PWM.
This will be a 'challenge'....
2nd job...do the 'record' portion. Remember you'll have to design some 'signal conditioning' circuitry to convert the sinewave audio to 0-5Vdc for the PICs ADC to convert.
This will be a challenge....
3rd job ..merging 1 and 2 with some kind of MMI..
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
toni
Joined: 26 Jan 2013 Posts: 9
|
|
Posted: Sun Jun 02, 2013 3:46 pm |
|
|
OK. Thank you |
|
![](templates/subSilver/images/spacer.gif) |
|