View previous topic :: View next topic |
Author |
Message |
hobiadami
Joined: 17 Oct 2006 Posts: 35 Location: City of Concrete
|
generating a small sampled sound w PIC |
Posted: Tue Oct 17, 2006 8:39 am |
|
|
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
they already sing and dance but with siple beep beep sounds :} _________________ www.endtas.com |
|
|
yerpa
Joined: 19 Feb 2004 Posts: 58 Location: Wisconsin
|
|
Posted: Tue Oct 17, 2006 3:39 pm |
|
|
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
|
isd |
Posted: Wed Oct 18, 2006 12:24 am |
|
|
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
|
|
Posted: Wed Oct 18, 2006 1:59 am |
|
|
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. |
|
|
|