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 CCS Technical Support

generating a small sampled sound w PIC

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



Joined: 17 Oct 2006
Posts: 35
Location: City of Concrete

View user's profile Send private message Visit poster's website ICQ Number

generating a small sampled sound w PIC
PostPosted: Tue Oct 17, 2006 8:39 am     Reply with quote

Hello,

I'm designing robot bugs as a hobby and sometimes sell them too

I'm working on several new robots and I think it would be very nice if one or all of them can generate a small detailed human sound, or an animal sound (maybe a hey!, or a hello, or help, or dog barking, anything is ok). Playing a small piece of pre-recorded sound (which is directly embedded in the code) would do nicely. and ofcourse the data should be in the internal memory only.

I saw an example on the web called 1-bit sound or something like that, written in assembly. I guess working on the same program code and implementing something similar in CCS c would do the job. But it also needs quite amount of time.

I guess there may be small examples in C too.

can anyone give me a link? or sample code on the topic? or an idea of generating sound effects that may make my robot bugs sing and dance Smile

they already sing and dance but with siple beep beep sounds :}
_________________
www.endtas.com
yerpa



Joined: 19 Feb 2004
Posts: 58
Location: Wisconsin

View user's profile Send private message Visit poster's website

PostPosted: Tue Oct 17, 2006 3:39 pm     Reply with quote

You can produce 8-bit audio at low sample rates (about 11 KHz) with the PIC, but that ties it up full-time. You could reduce PIC overhead by using the ISD analog flash chips to store your messages, then just trigger them with the PIC. The ISD devices are very nice for this, they include microphone input circuitry and a small audio amp.
hobiadami



Joined: 17 Oct 2006
Posts: 35
Location: City of Concrete

View user's profile Send private message Visit poster's website ICQ Number

isd
PostPosted: Wed Oct 18, 2006 12:24 am     Reply with quote

Thanks for the repply,

The overhead or the pic working full time for generating the audio is not an issue though it hasn't much to do anyway. The pic just controls several touch switches and turns on-off (forward&backward) two dc motors thats all.

but i guess a simple hello which lasts less than 1 seconds takes approximately 10kb of program memory and small pics (16Fxxx) doesn't have that either.

a telephone quality audio (around 3khz) is more than enough for me but that one requires 3k program memory as well, still much but realizable with 16F877 etc with 8kb program memory.
_________________
www.endtas.com
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Oct 18, 2006 1:59 am     Reply with quote

Why stick with the PIC16 processors? PIC18 processors are similary priced but have more memory and other goodies. PIC18 processors require another compiler than the PIC16 but for hobby projects you can change to the free student version of the Microchip C18 compiler.

Or add an external memory chip for storing the audio data. Serial flash memory is available in sizes of up to several megabytes, for example Atmel and STM sell 1Mbit (128kbyte) chips for around US$2.
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