Which is the frequency?


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Try this. At 20MHz you should have a 500kHz signal on the pin used.
    Code:
    DEFINE OSC 20
    TRISB.0 = 0
    
    ASM
    loop ; @ 20MHz 1us high + 1uS low
        bsf portb,0   ; 200nS
        goto $+1      ; 600nS
        goto $+1      ; 1000nS high
        bcf portb,0   ; 200nS
        goto $+1      ; 600nS
        goto loop     ; 1000nS low
    ENDASM
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Nitro's Avatar
    Nitro Guest


    Did you find this post helpful? Yes | No

    Lightbulb 20mhz?

    just bear in mind that the pic will divide whatever the clock frequency is by 4
    ie: if you have a 20mhz crystal, it will perform funcions @5mhz or one operation per 1/4 millionths of a second.

Similar Threads

  1. HPWM command and oscillator frequency
    By RussMartin in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th March 2009, 22:41
  2. Timer interrupt frequency
    By Samoele in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th January 2009, 23:49
  3. HPWM10 Frequency Updating
    By duncan303 in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 19th January 2008, 12:30
  4. inaccurate frequency using TMR1 PI18F452
    By nkarpovich in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 14th October 2006, 16:22
  5. frequency measurement
    By big-x in forum General
    Replies: 2
    Last Post: - 25th November 2005, 00:53

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