PDA

View Full Version : 18F4550 config



Christopher4187
- 26th June 2012, 14:31
I've searched and found threads on it but nobody came out and said "this is exactly what you write." I've tried a bunch of different things but I can't get it to work. I would like to know how this:

_CONFIG1H, _FOSC_HSPLL_HS_1H

can be set to HS instead of HSPLL.

ScaleRobotics
- 26th June 2012, 15:21
Yes, you can use HS. If you have pbp 3.x, you can check by looking in the pbp3 directory, under the device reference file.

For the 4550 osc configs, you will find these options:


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

Christopher4187
- 26th June 2012, 15:28
I'm stuck in time with PBP 2.50B. One of the programs I use will not work with a higher version unless I upgrade and I can't right now. Anyhow, I put this in my include file:

__CONFIG _CONFIG1H, _FOSC_HS

but it still doesn't work. If I can't put it in my include file, can I type anything into my program that would make it work? I'm used to using @device for 16F parts but I'm sure you already know it doesn't work with 18F parts.

ScaleRobotics
- 26th June 2012, 15:45
That is not one of the options from the list.

Here are the defaults from PBP


__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
__CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
__CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L


So you could change: _FOSC_HSPLL_HS_1H to _FOSC_HS_1H

To know you options (without pbp3) you can look at the .inc files in your mpasm suite folder. Mine is located here: C:\Program Files (x86)\Microchip\MPASM Suite

Christopher4187
- 26th June 2012, 15:48
It works! Thanks!

I'm easy to please;)

luxornet
- 19th November 2012, 14:39
Hi!
Can somebody help me to config 18F4550 (without USB) in PBP 2.60?
I want to use
1. internal 8MHz oscillator
or
2. external 20MHz oscillator.
My English skills doesn't allow me to understand datasheet.
Thank you very much.

mackrackit
- 21st November 2012, 08:42
Internal 8


DEFINE OSC 8
ASM
__CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_INTOSCIO_EC_1H
__CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L
ENDASM
OSCCON = %01110000

Andybrown
- 13th November 2017, 22:08
Hello folks,

I hope it finds all of you very well.
Honestly I have been confused.

In brief as a quick question under Mecanique PicBasic Compiler Ver. 2.5 for achieving to maximum available speed on PIC18F4550 (48MHz), Are below herewith setting “enough” in my program? USB connection is not the desired goal, just to achieve to Maximum available speed in an ordinary program.


ASM
__config _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
__config _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H

…. Etc…

ENDASM

.
.
.
DEFINE OSC 20
.
.
.

And a 20MHz XTAL be connected to Pins:13 & 14

Am I right?

Thank you very much in advance for your always Kind Support.

Regards,

Andy

P.S. 18F4550.inc File has been already edited. By adding “ ; ”

Scampy
- 14th November 2017, 19:57
I'm no expert, but from a quick google I found these settings for use with a 20mhz crystal from the datasheet with a 48mhz USB timing



ASM
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HS_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
ENDASM

Andybrown
- 14th November 2017, 22:23
Hello Scampy,

Thank you very much in advance for participating and answer,

As we see the result of your Google searching is as same as my text, isn't it?


from a quick google I found these settings for use with a 20mhz crystal from the datasheet with a 48mhz USB timing



ASM
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HS_1H



If our suggestions be right, perhaps the wrong point would be on some where else.

I still need HELP!

Regards,

Andy