Oscillator Setting (swimming through treacle)


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    MikeFahey's Avatar
    MikeFahey Guest


    Did you find this post helpful? Yes | No

    Default Re: Oscillator Setting (swimming through treacle)

    #include <P16F1823.inc>

    __CONFIG _CONFIG1, (_FOSC_INTOSC & _WDTE_ON & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF) ;18uA
    __CONFIG _CONFIG2, (_WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_19 & _LVP_ON)

    #define OSCCON__16MHz b'01111000'
    #define OSCCON___8MHz b'01110000'
    #define OSCCON___4MHz b'01101000'
    #define OSCCON___2MHz b'01100000'
    #define OSCCON___1MHz b'01011000'
    #define OSCCON_500KHz b'00111000' ;OSCCON default
    #define OSCCON_250KHz b'00110000'
    #define OSCCON_125KHz b'00101000'
    #define OSCCON__64KHz b'00100000'
    #define OSCCON__32KHz b'00011000'
    .
    .
    .
    BANKSEL OSCCON ; Switch internal clock speed ...
    movlw OSCCON___4MHz ; From settings above
    movwf OSCCON

    This is with the PLL disabled

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


    Did you find this post helpful? Yes | No

    Default Re: Oscillator Setting (swimming through treacle)

    sure shot, but BANKSEL and PBP are really poor bedfellow. you want to use CHK?RP instead on the asm side. Still, there's no advantages to define it on the asm side.
    Steve

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

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