How to set 18F2520 for INT OSC?


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Once it finally starts does it run correctly?
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Yes, it does. Regarding the EC settings, I tried using "_OSC_EC_1H", and did verify that I was getting 5 MHz (1/4 freq), out on A6. I'll be glad when this "CONFIG WIZARD" is working.

  3. #3
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    I didn't see your other questions... I'm using an external 20 MHz oscillator., and "DEFINE OSC 20" is in my code. I didn't have any trouble setting EITHER HS or EC settings (wierd), but it's the power-up delay that's confusing. Don't see a reason for it.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    HS should be it. OSC input on both OSC pins.

    What about MCLR?
    Is it pulled high?
    Since the time-outs occur from the POR pulse, if MCLR
    is kept low long enough, all time-outs will expire. Bringing
    MCLR high will begin execution immediately
    (Figure 4-5). This is useful for testing purposes or to
    synchronize more than one PIC18FXXXX device
    operating in parallel.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    I don't know why HS should be it. EC should be it. I'm using an External OSC. Input is only on pin A7. MCLR is pulled high w/ 4.7K, and snaps high immediately on power up.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    When you said you were not using a crystal I got to thinking resonator.
    You can use HS mode, OSC2 will just be an open pin.

    As for your problem I am at a loss.
    Maybe there is something at the beginning of your code messing things up?
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    This is my entire program, and I get a 25 sec. delay until the LED goes on.

    Code:
    ASM
         ;PORT A 
         CLRF PORTA 
         MOVLW 07h 
         MOVWF ADCON1                           ;A/D'S OFF 
         MOVWF 07h 
         MOVWF CMCON                            ;COMPARATORS OFF  
         MOVLW 00000000b                        ;PIN DIRECTION PORT A  
         MOVWF TRISA 
    ENDASM
    
    DEFINE OSC 20                                
    LOW PORTA.6                                     'TURN LED ON
    STOP

    Thanks anyway, Dave!

Members who have read this thread : 1

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