CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Storing sound in wav format in sd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
toni



Joined: 26 Jan 2013
Posts: 9

View user's profile Send private message Yahoo Messenger

Storing sound in wav format in sd
PostPosted: Sun Jun 02, 2013 11:32 am     Reply with quote

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
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sun Jun 02, 2013 11:51 am     Reply with quote

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
temtronic



Joined: 01 Jul 2010
Posts: 9173
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jun 02, 2013 12:29 pm     Reply with quote

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
toni



Joined: 26 Jan 2013
Posts: 9

View user's profile Send private message Yahoo Messenger

PostPosted: Sun Jun 02, 2013 1:37 pm     Reply with quote

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.
temtronic



Joined: 01 Jul 2010
Posts: 9173
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jun 02, 2013 2:09 pm     Reply with quote

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
toni



Joined: 26 Jan 2013
Posts: 9

View user's profile Send private message Yahoo Messenger

PostPosted: Sun Jun 02, 2013 3:08 pm     Reply with quote

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.
temtronic



Joined: 01 Jul 2010
Posts: 9173
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jun 02, 2013 3:14 pm     Reply with quote

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
toni



Joined: 26 Jan 2013
Posts: 9

View user's profile Send private message Yahoo Messenger

PostPosted: Sun Jun 02, 2013 3:46 pm     Reply with quote

OK. Thank you
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group