Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Generating Random High/Low Sounds Using PIC Controller?

  1. Dec 21, 2014 #1
    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.
     
  2. jcsd
  3. Dec 21, 2014 #2

    meBigGuy

    User Avatar
    Gold Member

    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.
     
  4. Dec 21, 2014 #3
    Thank you meBigGuy! Let me see how far I can get with this now.
     
  5. Dec 22, 2014 #4
    you could always hook it up to a dtfm chip.
     
  6. Dec 23, 2014 #5

    meBigGuy

    User Avatar
    Gold Member

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Generating Random High/Low Sounds Using PIC Controller?
  1. Sound generator (Replies: 2)

Loading...