Maker Pro
Maker Pro

Creating sound effects with PIC microcontroller

I am developing a "smart" alarm clock. I need to determine how to I
will generate the alarm sounds. The main requirement is the ability to
generate loud sounds and to vary the sound volume. One option is to use
a PIC18Fxx processor (already part of the circuit) to generate the
alarm tones and then feed them through an audio amplifier IC and small
speaker. I could use a digital potentiometer to vary sound volume,
however if I could get the same effect by using the PIC's 10-bit PWM
peripherals it would be ideal.
Does anyone have code examples or strategies for creating such sound
effects using a PIC processor? Thanks
 
J

Jasen Betts

Jan 1, 1970
0
["Followup-To:" header set to sci.electronics.misc.]
I am developing a "smart" alarm clock. I need to determine how to I
will generate the alarm sounds. The main requirement is the ability to
generate loud sounds and to vary the sound volume. One option is to use
a PIC18Fxx processor (already part of the circuit) to generate the
alarm tones and then feed them through an audio amplifier IC and small
speaker. I could use a digital potentiometer to vary sound volume,
however if I could get the same effect by using the PIC's 10-bit PWM
peripherals it would be ideal.
Does anyone have code examples or strategies for creating such sound
effects using a PIC processor? Thanks

map out the wave form you want and send it to the PWM, connect the PWM to
the amplifier, with a bit of work (and if the chip and PWM is fast enough)
you can even go polyphonic.

to reduce the volume either shift the values right before outputting them
or use a lower waveform map.

I have a code example, but it's for AVR 90S2313 (10MHz)

Bye.
Jasen
 
J

Jim

Jan 1, 1970
0
I am developing a "smart" alarm clock. I need to determine how to I
will generate the alarm sounds. The main requirement is the ability to
generate loud sounds and to vary the sound volume. One option is to use
a PIC18Fxx processor (already part of the circuit) to generate the
alarm tones and then feed them through an audio amplifier IC and small
speaker. I could use a digital potentiometer to vary sound volume,
however if I could get the same effect by using the PIC's 10-bit PWM
peripherals it would be ideal.
Does anyone have code examples or strategies for creating such sound
effects using a PIC processor? Thanks

If the sound is just tones or assending/descending tones then I would be
tempted to use a pieze instead of a speaker. Nice and loud, only a
darlington driver required.
As far as varying the volume then this is easilly achievable using one of
the PWM modules on the 18F part. Connect the output of the PWM pin through a
charging resistor to a capacitor. Connect the capacitor to the power pin of
your darlington pair. This will give you control over the voltage presented
to the piezo. I have done this before and it works very well. If I remember
correctly using a 1K series resistor to 10uF capacitor is perfectly adequate
for volume control.

If you need PWM code then I should be able to dig some out on Monday. But
where would the fun be in that? :)

Have fun
Jim
www.picmodules.com
 
C

CWatters

Jan 1, 1970
0
I am developing a "smart" alarm clock. I need to determine how to I
will generate the alarm sounds. The main requirement is the ability to
generate loud sounds and to vary the sound volume. One option is to use
a PIC18Fxx processor (already part of the circuit) to generate the
alarm tones and then feed them through an audio amplifier IC and small
speaker. I could use a digital potentiometer to vary sound volume,
however if I could get the same effect by using the PIC's 10-bit PWM
peripherals it would be ideal.
Does anyone have code examples or strategies for creating such sound
effects using a PIC processor? Thanks

Google suggests PICBASIC supports the BASIC SOUND command.
 
A

Alex Gibson

Jan 1, 1970
0
I am developing a "smart" alarm clock. I need to determine how to I
will generate the alarm sounds. The main requirement is the ability to
generate loud sounds and to vary the sound volume. One option is to use
a PIC18Fxx processor (already part of the circuit) to generate the
alarm tones and then feed them through an audio amplifier IC and small
speaker. I could use a digital potentiometer to vary sound volume,
however if I could get the same effect by using the PIC's 10-bit PWM
peripherals it would be ideal.
Does anyone have code examples or strategies for creating such sound
effects using a PIC processor? Thanks

www.beyondlogic.org

http://www.beyondlogic.org/pic/ringtones.htm works with 16f87x
does it in software
good for awful sounding phone ring tones
works with Hitech compiler or demo version
 
T

Tom Twist

Jan 1, 1970
0
["Followup-To:" header set to sci.electronics.misc.]
I am developing a "smart" alarm clock. I need to determine how to I
will generate the alarm sounds. The main requirement is the ability to
generate loud sounds and to vary the sound volume. One option is to use
a PIC18Fxx processor (already part of the circuit) to generate the
alarm tones and then feed them through an audio amplifier IC and small
speaker. I could use a digital potentiometer to vary sound volume,
however if I could get the same effect by using the PIC's 10-bit PWM
peripherals it would be ideal.
Does anyone have code examples or strategies for creating such sound
effects using a PIC processor? Thanks

map out the wave form you want and send it to the PWM, connect the PWM to
the amplifier, with a bit of work (and if the chip and PWM is fast enough)
you can even go polyphonic.

to reduce the volume either shift the values right before outputting them
or use a lower waveform map.

I have a code example, but it's for AVR 90S2313 (10MHz)

Jasen

Would you care to share your AVR code?

I tried to contact you by email, but it bounced.(I removed nospam.)

Tom
 
J

Jasen Betts

Jan 1, 1970
0
Would you care to share your AVR code?

I tried to contact you by email, but it bounced.(I removed nospam.)

hmm...
I'll look into that...
seems I've got something misconfigured here...
should be better now.

Bye.
Jasen
 
Top