Pic oscillator?


Closed Thread
Results 1 to 6 of 6

Thread: Pic oscillator?

Hybrid View

  1. #1
    Qacer's Avatar
    Qacer Guest

    Question Pic oscillator?

    Hey all,

    I was reading the PIC Manual on its internal oscillators and found out that the frequency depends on VDD as well as the external resistor and capacitor. On all of their examples, they are using VDD=5V.

    I was wondering if I can still achieve a 4MHz internal oscillator value if I use a voltage of, say, 3.3V. I'm using a PIC12F675 as my first newbie chip.

    Thanks!

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Qacer, The internal 4 Mhz. oscillator does not use any external capacitor or resistor. The mode you speak of is RCIO or RC. These modes require the external components to for the oscillator. Check the data sheet....

    Dave Purola,
    N8NTA

  3. #3
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks again, Dave! I'm still immersing myself with the datasheet and PIC manual for midrange microcontrollers.

  4. #4
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Question

    By the way, I have another question. I was reading the PIC12F675 data sheet and it states that the following code will calibrate the internal PIC oscillator:

    bsf STATUS, RP0 ;Bank 1
    call 3FFh ;Get the cal value
    movwf OSCCAL ;Calibrate
    bcf STATUS, RP0 ;Bank 0

    Am I doing the right thing using my BASIC coding?

    changed 12F675.inc
    __config _INTRC_OSC_CLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF


    My next question is: how do I implement the calibration code in BASIC?

    Is this right?

    OSCVAL equ 3FFh ; assign 3FFh to OSCVAL
    call OSCVAL
    OSCCAL = OSCVAL ; ??


    Thanks!

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


    Did you find this post helpful? Yes | No

    Default

    just a tip
    DEFINE OSCCAL_1K 1
    DEFINE OSCCAL_2K 1
    Steve

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

  6. #6
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by mister_e
    just a tip
    DEFINE OSCCAL_1K 1
    DEFINE OSCCAL_2K 1

    Thanks, mister_e! I knew I saw this somewhere. I started flipping through my manual and found it on page 12. One line is definitely much shorter than a couple.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  3. Replies: 67
    Last Post: - 8th December 2009, 02:27
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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