30hz sound


Closed Thread
Results 1 to 2 of 2

Thread: 30hz sound

  1. #1
    Join Date
    May 2004
    Location
    Denmark
    Posts
    9

    Default 30hz sound

    I need som help too make a 30 hz sound wwith a PIC12F675

    Thanks
    Kent

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    FREQOUT is the obvious choice, but it won't work with the 12 series PIC's. So you have to generate the tone manually by switching a pin on/off...

    The Period time of 30Hz is 33.333mS (1/freq).

    That means your ON time is 16.666mS and your OFF time is 16.666mS (16.666+16.666=33.333mS).

    Knowing that, and the blink.bas example in the PBP manual, are you able to carry forward the changes needed or are you still stuck?

    Naturally you no longer have an LED connected, but a Speaker or Sounder to the relevant pin. Note, don't connect a low ohmage speaker directly to the pin, but via a Capacitor (eg 1uF).

    Now the 12F is a little tricky to start playing with if you have never met it before. So I've appended a program for you to play with, however, before downloading it, I would ask you to try modifying blink.bas for your 12F675 first. You learn more by doing yourself rather than by copying someone elses's code.

    Finally, if you do download my program, I refer you to the PIC's Datasheet to cross-check the settings of TRISIO, ANSEL and CMCON. Look in the "Special Features of the CPU" section to work out the device programming definitions that I've used.

    Melanie
    Attached Files Attached Files

Similar Threads

  1. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 06:28
  2. Wanted: Sound chip interfaced with pic
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 8th September 2008, 13:38
  3. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  4. Sound and sound control with minimal parts
    By bartman in forum General
    Replies: 23
    Last Post: - 18th January 2005, 14:08
  5. Re: quick fix for sound command?
    By Melanie in forum Code Examples
    Replies: 0
    Last Post: - 9th July 2004, 01:44

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts