Configure Internal Oscillator 16F628A


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2011
    Posts
    15

    Default Configure Internal Oscillator 16F628A

    I have been all over this forum looking for a solution on how to enable the internal oscillator on a PIC16F62XA. I have always used an external clock and done some complex stuff, but this is driving my crazy. 2 days no luck. I am trying this simple hunk of code now, before I try my app. I would like to bring the clock out on a pin, CLKOUT pin, so I can put my scope on it to see if it is going.

    Using Pic Basic Pro 2.43, Microcode Studio 3.0.0.5, and a WARP13A programer.
    I have tried @ _config _INTOSC _OSC and others. There have been many iterations with no results. Can't be that hard, Can it? Strange that some of the PIC books I have don't spell it out either.

    Here is the simple code.

    Thanks
    Scott C.

    @ DEVICE PIC16F628A, INTOSC_OSC_CLKOUT
    Define OSC 4 ' 4MHz

    LED1 VAR PORTA.1
    LED2 VAR PORTA.2

    CMCON=7
    VRCON=0
    TRISA = 0
    TRISB = %00000000

    STARTMAIN:
    LED1 = 1
    LED2 = 1

    PAUSE 750
    LED1 = 0
    LED2 = 0

    GOTO STARTMAIN

    END

  2. #2
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default Re: Configure Internal Oscillator 16F628A

    as you define the chip under microcode at the top by selecting device, you need not mention device name in mai program. later, while loading thehex, you can changer setting like internal osc with clk out at programmer level.
    however, after the led11 and led2 are made off, you add dpause 750 again. otherwiseyou would npot notice the blinking.
    all the best
    Regards,
    Sarma

  3. #3
    Join Date
    Aug 2011
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Re: Configure Internal Oscillator 16F628A

    Never mind! I got it! I had put the wrong value resistor in the MCLR pin(4). I guess that's what happens when you get distracted by wife, and kids homework huh! Something so simple that I overlooked.

    Sorry for A) not checking a simple thing like that. B) talking up your time. Now I can load my code to do what I want and go.

    Thanks

  4. #4
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default Re: Configure Internal Oscillator 16F628A

    perhaps i too am leaning off late. you need not feel sorry please.
    Regards,
    Sarma

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