How to use internal oscilator of PIC16F628A?


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2011
    Location
    Skopje,Macedonia
    Posts
    71

    Default How to use internal oscilator of PIC16F628A?

    Hi all,
    I want to know how to use internal oscilator of PIC16F628A,the 4Mhz crystal oscilator?Which comand should I use to turn on the internal oscilator,I use PBP and MCS 2.60!
    Thanks

  2. #2
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: How to use internal oscilator of PIC16F628A?

    I used something like this :
    Code:
    @ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF
    
    DEFINE  OSC 4

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


    Did you find this post helpful? Yes | No

    Default Re: How to use internal oscilator of PIC16F628A?

    Steve

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

  4. #4
    Join Date
    Jan 2011
    Location
    Skopje,Macedonia
    Posts
    71


    Did you find this post helpful? Yes | No

    Default Re: How to use internal oscilator of PIC16F628A?

    how about the PCON register?Can I write PCON = $xx and to turn on the internal oscilator?

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


    Did you find this post helpful? Yes | No

    Default Re: How to use internal oscilator of PIC16F628A?

    I don't think so, you want to specify the right one at the beginning. Some 18F allow to switch over the internal to external on the fly (or in case of a external clock fail), but I'm pretty confident you can't do it with grand'pa 16f628.
    Steve

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

  6. #6
    Join Date
    Mar 2011
    Location
    cape town, south africa
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: How to use internal oscilator of PIC16F628A?

    Quote Originally Posted by fratello View Post
    I used something like this :
    Code:
    @ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF
    
    DEFINE  OSC 4
    I'm stuck on a very similar (i think!) problem;

    Using a PIC16F777 for the first time, which has an internal Osc. I'd like to get it running at 4MHz, but using fratello's DEFINE code modified to:
    Code:
     @ DEVICE pic16F777, INTRC_OSC
    
    DEFINE  OSC 4
    ....as does not work. the 4MHz, seems much more like 4Hz.

    Any help?! thanx!

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


    Did you find this post helpful? Yes | No

    Default Re: How to use internal oscilator of PIC16F628A?

    Open the datasheet under OSCCON register, and see the default setting., from there change it.
    Steve

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

  8. #8
    Join Date
    Mar 2011
    Location
    cape town, south africa
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: How to use internal oscilator of PIC16F628A?

    Thank you Steve - got it working... but i do not understand all the bits in that register;

    IOFS: INTOSC Frequency Stable bit ?
    SCS<1:0>: Oscillator Mode Select bits ?

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