external oscillation


Closed Thread
Results 1 to 17 of 17

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Yup PWM is the way to go. You can use the PBP HPWM or setting the PIC register as Sayzer said.

    Quote Originally Posted by Sayzer
    mister_e, pls correct me if I am wrong
    I got the same results
    Steve

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

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I got it going with a 4Mhz oscillator. Here is the program.
    I wanetd to use the 20Mhz oscillator. and it do not work. I change the 4 to a 20 in the program and changes the crystal and the capacitor to 22pF and it is not oscillating, anybody knows why. is there a command I nee to do ?


    Define LOADER_USED 1
    DEFINE OSC 4 'Using 4MHz oscillator
    TRISB = 0

    loop: FREQOUT PORTB.1,10000,20000 ' Turn on PORTB for 1- sec at20Khz
    Pause 100 ' Delay for .5 seconds

    Goto loop ' Go back to loop and blink LED forever

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok added this line :

    @ DEVICE HS_OSC

    and now it works

  4. #4
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I am trying ot get a sin wave at the output. From the manuals of picbasic pro, they say to add a low pass filter, I did this, it dos remove the extra noise, but it does not make it a sinwave. Anybody know how to make it a sin wave ?

    ken

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


    Did you find this post helpful? Yes | No

    Default

    Did you check this post?

    http://www.picbasic.co.uk/forum/showthread.php?t=718



    -------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    If it's for a single frequency with a 50% duty cycle you could still use a pair of integrator made with Op-Amp.
    Steve

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

  7. #7
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I need 6 frequencies.
    maybe using an analog circuit using amplifiers to make the oscillation and the pic to control + / - a few kilohertz to get lets say between 20 to 30 khz ??
    The goal of this is to create an ultrasonic bird repeller, maybe the square waves (although noisy) can scare them off.

    k

Similar Threads

  1. Replies: 1
    Last Post: - 28th January 2010, 23:15
  2. TMR1 external LP xtal setup check
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th October 2009, 19:11
  3. How to use an external oscillator
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th February 2008, 15:19
  4. External Control Lines
    By weirdjim in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd August 2007, 20:29
  5. switching external vref+ and vdd vref
    By alejandro_halon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th February 2005, 21:13

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