Oscilloscope help


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Re: Oscilloscope help

    Hello kellyseye, I tried the following, but no sucess:
    Code:
    while 1
    		Pulsout PortC.0,25
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    		Pulsout PortC.0,24
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    		Pulsout PortC.0,23 
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    		Pulsout PortC.0,22
    @	NOP
    @	NOP
    @	NOP
    @	NOP		
    		Pulsout PortC.0,20 
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    		Pulsout PortC.0,19
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    		Pulsout PortC.0,18 
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    		Pulsout PortC.0,17
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    		Pulsout PortC.0,16 
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    		Pulsout PortC.0,15
    @	NOP
    @	NOP
    @	NOP
    @	NOP
    
    Wend

  2. #2
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Re: Oscilloscope help

    Here I have recorded the sound produced by the buzzer. Please rename the attachment to "Memo.m4a" from ".pdf" as I could not upload it in its original format.
    Attached Images Attached Images

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Oscilloscope help

    Try this ...
    You'll need to put the piezo circuit on a CCP pin.

    Code:
    Freq  VAR WORD
    
    Main:
        FOR Freq = 3000 TO 4000 STEP 10    
            HPWM 1, 127, Freq
            PAUSE 1 
        NEXT Freq
    GOTO Main
    It should sound something like this ... http://support.melabs.com/DT/Piezo.wma
    DT

  4. #4
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Re: Oscilloscope help

    Thanks Darrel, I will try it tomorrow with 16f877A which I have. But I would like to ask if this task can be made possible using a smaller PIC without an HPWM, I would like to use 16F676 if possible as it is very easily available and where I am and if this takes off then it will be economical as well.

    In the mean time I am attaching the datasheet of the Chinese uC which is controlling the base of the NPN transistor connected to the piezo & coil. The signal comes out from PIN 2, which to me seems just an I/O pin.

    Thanks
    Attached Images Attached Images

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Oscilloscope help

    Yes, of course it can.
    It's only 3-4 khz. You can generate that in software easily.

    But see if it drives your piezo first.
    I was assumming your piezo has a resonant frequency of ~3.5khz.
    Last edited by Darrel Taylor; - 8th August 2012 at 15:07.
    DT

  6. #6
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Smashing results

    THANKS Darrel, it worked like a charm with HPWM. Any pointers as to how to do without it.

    I tried FREQOUT
    Code:
        FOR Freq = 3000 TO 4000 STEP 10    
            FREQOUT PortC.2,1, Freq
        NEXT Freq
    but the results were not the same, not even near enough, the pulsing sound is not that prominent

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Smashing results

    FREQOUT makes sine waves and must be filtered, which is not what you need.
    Try this ...

    Code:
    PiezoPIN  VAR PORTC.2
    TMR0IF    VAR INTCON.2
    Width     VAR BYTE
    OPTION_REG = %11010011 ; TMR0 1:16
    
    Alarm:
        FOR Width = 161 TO 120 STEP -1
            WHILE !TMR0IF
                TOGGLE PiezoPIN
                PAUSEUS Width
                TOGGLE PiezoPIN
                PAUSEUS Width
            WEND
            TMR0IF = 0
        NEXT Width
    GOTO Alarm
    DT

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