1
\$\begingroup\$

I am trying to set up a Serial Port for a PIC18F2550 Microchip. I am using MPLAB.

In the 18F2550TMPO.ASM Template the statement CONFIG FOSC = XT_XT ;XT oscillator, XT used by USB.

I need to change it, so I am looking for the right statement. I could not find CONFIG FOSC = XT_XT in the MPASM™ Assembler User’s Guide or the PIC18F2455/2550/4455/4550 Datasheet. I typed it into google and it did not come up anywhere.

Where would I find this information that follows the same format used in the 18F2550TMPO.ASM Template provided by Microchip?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

It's described in comments the file "P18F2550.INC", a section of which I've reproduced below:

;   Oscillator Selection bits:
;     FOSC = XT_XT         XT oscillator (XT)
;     FOSC = XTPLL_XT      XT oscillator, PLL enabled (XTPLL)
;     FOSC = ECIO_EC       EC oscillator, port function on RA6 (ECIO)
;     FOSC = EC_EC         EC oscillator, CLKO function on RA6 (EC)
;     FOSC = ECPLLIO_EC    EC oscillator, PLL enabled, port function on RA6 (ECPIO)
;     FOSC = ECPLL_EC      EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)
;     FOSC = INTOSCIO_EC   Internal oscillator, port function on RA6, EC used by USB (INTIO)
;     FOSC = INTOSC_EC     Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)
;     FOSC = INTOSC_XT     Internal oscillator, XT used by USB (INTXT)
;     FOSC = INTOSC_HS     Internal oscillator, HS oscillator used by USB (INTHS)
;     FOSC = HS            HS oscillator (HS)
;     FOSC = HSPLL_HS      HS oscillator, PLL enabled (HSPLL)

The actual values used for CONFIG1H are also in that file:

;----- CONFIG1H Options --------------------------------------------------
_FOSC_XT_XT_1H       EQU  H'F0'    ; XT oscillator (XT)
_FOSC_XTPLL_XT_1H    EQU  H'F2'    ; XT oscillator, PLL enabled (XTPLL)
_FOSC_ECIO_EC_1H     EQU  H'F4'    ; EC oscillator, port function on RA6 (ECIO)
_FOSC_EC_EC_1H       EQU  H'F5'    ; EC oscillator, CLKO function on RA6 (EC)
_FOSC_ECPLLIO_EC_1H  EQU  H'F6'    ; EC oscillator, PLL enabled, port function on RA6 (ECPIO)
_FOSC_ECPLL_EC_1H    EQU  H'F7'    ; EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)
_FOSC_INTOSCIO_EC_1H EQU  H'F8'    ; Internal oscillator, port function on RA6, EC used by USB (INTIO)
_FOSC_INTOSC_EC_1H   EQU  H'F9'    ; Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)
_FOSC_INTOSC_XT_1H   EQU  H'FA'    ; Internal oscillator, XT used by USB (INTXT)
_FOSC_INTOSC_HS_1H   EQU  H'FB'    ; Internal oscillator, HS oscillator used by USB (INTHS)
_FOSC_HS_1H          EQU  H'FC'    ; HS oscillator (HS)
_FOSC_HSPLL_HS_1H    EQU  H'FE'    ; HS oscillator, PLL enabled (HSPLL)

The MPASM Assembler documentation directs you to the .INC file:

ASM

\$\endgroup\$
1
  • \$\begingroup\$ I looked for many things in the past few weeks, their are questions like this in all the different forums. With the help of stackexchange I have found many of my questions answered. \$\endgroup\$
    – user66377
    Mar 27, 2015 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.