Which is the frequency?


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    fabritio's Avatar
    fabritio Guest

    Default Which is the frequency?

    Which is the frequency of this program?
    I am using a pic16f876 with a 20Mhz Quartz...
    Should it be same 20Mhz or not?
    Thank you!!


    i var word

    TRISC = 0
    PORTC = 0


    inizia:

    PORTC = %00000000
    for i=0 to 255
    PORTC = PORTC + %1
    NEXT
    goto inizia

    end

  2. #2
    fabritio's Avatar
    fabritio Guest


    Did you find this post helpful? Yes | No

    Default

    With the oscilloscope it comes out a frequency of 200 khz.
    A change of state for the LSB every 5 microseconds.
    Is it right?
    How can i have 20 MHz as the crystal resonator???

  3. #3
    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

  4. #4
    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