Pic oscillator?


Closed Thread
Results 1 to 6 of 6

Thread: Pic oscillator?

Hybrid View

  1. #1
    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!

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

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