Generating Random High/Low Sounds Using PIC Controller?

In summary, the conversation centers around the individual's goal to generate random high/low frequency noises through an amplifier using a PIC12F675P controller. They are seeking guidance on how to achieve this, including determining the frequency and duration of the sounds and potentially using a random number generator or a DTFM chip. Different methods and approaches are discussed, including utilizing a simple square wave or implementing a simple modem with external filters. The individual expresses gratitude for the suggestions and plans to further explore their options.
  • #1
Pr0t0n
2
0
I'm new to the electrical engineering field and need guidance on how I can program a PIC (PIC12F675P) controller to generate random high/low frequency noises through a amplifier (TDA2822M). The sounds I'm aiming for need to be similar to those generated by a dial up modem.

I will appreciate any guidance I can get.
 
Engineering news on Phys.org
  • #2
The simplest is to just bit-bang a pic IO pin at audio rates. Deciding what frequency for what duration to generate (ie, random) requires some sort of random number generators constrained to to provide numbers withing the frequency range and durations of the sounds you desire. If you want changing amplitudes, that would be a third number required. An lfsr algorithm will generated pseudo random numbers. See http://en.wikipedia.org/wiki/List_of_random_number_generators. Here is some PIC code for such a thing: http://www.dontronics.com/psbpix/random.html

If you want waveforms that are not simple squarewaves, then you need to determing how to generate the waveform you want.
 
  • #3
Thank you meBigGuy! Let me see how far I can get with this now.
 
  • #4
you could always hook it up to a dtfm chip.
 
  • #5
My GPIO solution is pretty simplistic, but I don't know how accurate you need the sounds to be. That is, how much like a 1200 baud, or 2400 baud or whatever. The square wave won't sound exactly like a modem. thankz suggestion will sound exactly like a modem since it will be one. or, you can possibly implement a simple modem in the pic and some external filters to get the sound right. I don't know what you are really striving for.
 

1. How can I generate random high/low sounds using a PIC controller?

To generate random high/low sounds using a PIC controller, you can use a pulse width modulation (PWM) technique. This involves varying the duty cycle of a square wave signal to produce different pitches and frequencies, creating a high/low sound effect. You can also use a random number generator function in your code to produce random pulses and create a more unpredictable sound pattern.

2. What type of PIC controller is best for generating random high/low sounds?

There are many different types of PIC controllers available, but for generating random high/low sounds, a microcontroller with a built-in PWM module would be most suitable. This allows for more precise control over the duty cycle and frequency of the square wave signal, resulting in a better quality sound.

3. Can I adjust the volume of the high/low sounds generated by the PIC controller?

Yes, you can adjust the volume of the high/low sounds by controlling the amplitude of the square wave signal. This can be done by adjusting the voltage levels or using a variable resistor in the circuit. You can also use a digital potentiometer to control the output volume through the PIC controller.

4. Is it possible to create a specific sequence of high/low sounds using the PIC controller?

Yes, it is possible to create a specific sequence of high/low sounds using a PIC controller. This can be achieved by programming the microcontroller to generate a predetermined pattern of pulses, or by using a lookup table to store different sound sequences and playing them back in a specific order.

5. Are there any limitations to generating random high/low sounds with a PIC controller?

One limitation of using a PIC controller to generate random high/low sounds is the limited memory and processing power of the microcontroller. This may limit the complexity and length of the sound sequences that can be created. Additionally, the quality of the sound may be affected by external factors such as the circuit design and the quality of the output speaker.

Similar threads

Replies
31
Views
3K
  • Quantum Physics
Replies
26
Views
2K
  • Electrical Engineering
Replies
14
Views
4K
Replies
27
Views
4K
Replies
1
Views
958
  • Electrical Engineering
Replies
25
Views
2K
  • Electrical Engineering
Replies
3
Views
1K
  • Electrical Engineering
Replies
6
Views
1K
  • Electrical Engineering
Replies
5
Views
2K
  • Electrical Engineering
Replies
7
Views
2K
Back
Top