Using Sound cmd on 16F88


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Gator_sound's Avatar
    Gator_sound Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Steve,

    Its a cheap Radio Shack Piezo Element 1500-3000Hz Buzzer (#273-073):

    I get a working continuous buzzing sound in it but its not loud enough. I used a function generator and it produced a better sound than what I'm getting from my PIC. Hope this info helps.

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Gator_sound
    ...1500-3000Hz.. I used a function generator and it produced a better sound than what I'm getting from my PIC...

    Since you are using Note 127, you are driving your piezzo by 10,000Hz.
    Check Sound command details to find the correct Note number which should give you a frequency between 1500-3000Hz. So g-spot of this piezzo has been found & touched!


    Quote Originally Posted by mister_e
    LMAO! i guess it would depend of the hardware
    Quote Originally Posted by mister_e
    Provide your piezo part # so we could try to find the g-spot of it !
    The hardware is ticking like a Swiss clock. No doubt on that!
    But, sometimes when you know for sure that you are not even close to g-spot, you still get a loud sound. How about that?




    -------------------------------
    Last edited by sayzer; - 8th October 2006 at 19:58.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sayzer
    But, sometimes when you know for sure that you are not even close to g-spot, you still get a loud sound. How about that?
    I could disgress and talk about using the right i/o but...

    Gator, use HPWM and a loop like that
    Code:
    Freq var Word
    
    Start:
        For Freq=1500 to 3000 step 100
            HPWM 1,Freq, 127
            Pause 200
            next
        Goto Start
    You'll notice some 'volume' change on every different frequency, choose the louder one. Using the Sayzer driver circuit will add to your pleasure.

    OR use your function generator, measure the frequency once you hit the louder frequency, and apply it on the HPWM command.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Gator_sound's Avatar
    Gator_sound Guest


    Did you find this post helpful? Yes | No

    Default

    Hi mister_e,

    Are you talking about using the HPWM on the 16f88 or a PIC with a physical PWM pin?

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Both.. THE PIC16F88 have a built-in PWM module... also named CCP.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Gator_sound's Avatar
    Gator_sound Guest


    Did you find this post helpful? Yes | No

    Default

    mister_e,

    Thank you and sayzer for the information. If its not too much of a hassle is it possible to provide an example for the PWM using the CCP register. I'm still trying to get used to programming in basic. Programming in assembly has thrown me off when I'm thinking about programming in basic. Thanks in advance.

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    HPWM will handle it for you. if 8 bit resolution is enough, it's the easiest way.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  3. Alfat Sd/mmc
    By eoasap in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 24th July 2006, 06:10
  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 : 0

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