SOUND Generates tone and/or white noise
Hi Dave,
There are two things that you may want to try.
Find a way to band-pass or “restrict” the audio going through your amplifier.
This will make your voice sound like it is coming over the radio (like a telephone voice sound).
I have never made white noise with a PIC.
The PICBASIC Pro manual says it is possible with the sound command.
See PBP manual: 5.78. SOUND
SOUND Generates tone and/or white noise on the specified Pin.
You may have to make a filter similar to the one in the DTMFOUT section.
See PBP manual: 5.17. DTMFOUT
Maybe leaving the signal as a white noise square wave would enhance the “radio” sound. This will be a low level volume. It will have to be injected into the amplifier at a low level stage. Hope someone that has used the white noise jumps in here.
If you are set-up to breadboard the PIC SOUND command, you should try it to see (or hear) for yourself. It should sound like the burst of broken squelch a radio makes when turning back to receive.
This sounds like a do-able project but it may take you a little more time that you might expect. The fun of doing it would be the reason, not the money saved.
-Adam-
All you need is an ASM interrupt.
Hi,
If you use an 8 MHz crystal as your oscillator and let your timer0 run free it would interrupt @ 7.8Khz (Thanks to MisterE for the PIC multicalc utility). Enable timer0 interrupt. In the interrupt routine you don't need to reload timer0 as it already rolls over. This assures a solid timebase interrupting at fixed intervals. On the interrupt set the Go/Done bit of your ADC. Use the ADC in 8 bit mode. When the conversion is done. Simply dump the ADRESH value to the PWM duty register. All this happens in the interrupt routine. Let the AD module run continuosly so that sampling (acquisition) actually occurs when you are outside the interrupt. This should be quite simple to achieve. You get enough time outside the ISR to decide whether the ADC is sampling 0 or say 127 (when you are DC offsetting the Audio that gives you a 0 for the most negative peak, and 255 for most positive sort of pseudo signed ADC you loose resolution again, distort more).