CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    ok i used that _FOSC_INTOSC_HS_1H code from the other article and it works, but I dont get where the INTOSC came from, heres the info strait from the 4550 datasheet

    FOSC3:FOSC0: Oscillator Selection bits(1)
    111x = HS oscillator, PLL enabled (HSPLL)
    110x = HS oscillator (HS)
    1011 = Internal oscillator, HS oscillator used by USB (INTHS)
    1010 = Internal oscillator, XT used by USB (INTXT)
    1001 = Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)
    1000 = Internal oscillator, port function on RA6, EC used by USB (INTIO)
    0111 = EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)
    0110 = EC oscillator, PLL enabled, port function on RA6 (ECPIO)
    0101 = EC oscillator, CLKO function on RA6 (EC)
    0100 = EC oscillator, port function on RA6 (ECIO)
    001x = XT oscillator, PLL enabled (XTPLL)
    000x = XT oscillator (XT)

    i figured it should read _FOSC_INTHS_HS_1H but thats not right, so where is it that it shows the INTOSC or where did this come from?

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    If you read the link that Darrel gave you it tells you to look in the MPASM directory for the *.inc file. All of the config settings are there.

    And you do have to have MPASM installed to use an 18Fxxx chip.
    From the PBP 18F4550.inc
    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F4550, r = dec, w = -311, w = -230, f = inhx32
    INCLUDE "P18F4550.INC" ; MPASM Header
    __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
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 32
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    i did install MPLAB
    So you do have MPASM. It is part of MPLAB.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: CONFIGS? setting PIC fuses? Configurations of Hardware settings of a PIC.

    There's two steps to going from a PBP program to a .hex file.
    First the PBP program gets compiled (that's what PBP does, it's a compiler and it compiles programs). For this the compiler uses its own device specific .inc file located in the PBP folder. The output of the compiler is basically your program converted into assembly language. This then needs to be run thru an assembler and IT uses it's own device specific .inc file which is located in the MPASM folder. The output of the assembler is your final .hex file that you then program into the PIC.

    If you've noticed the __CONFIG...... are "enclosed" with ASM / ENDASM meaning that it is assembly. PBP doesn't know or care about that - it's directly passed to the assembler and it's the assemblers job to interpret what to do with it.

    Prior to PBP3 the compiler came with its own assembler, called PM but it has never worked for 18-series chips so you MUST have MPASM installed somewhere on your system and you MUST have your IDE (MicroCodeStudio - which is nothing more than a text editor tailored specifically for PBP code really) pointing to the install folder of MPASM - otherwise you wouldn't be able to compile and assemble anything for 18-series devices.

    i figured it should read _FOSC_INTHS_HS_1H but thats not right
    Don't guess. Open the .INC file in the MPASM folder, scroll down to find the options for the CONFIG1H register and it'll TELL you what it the correct names for all the options: _FOSC_INTOSC_HS_1H - if that is the correct one for your application is another question. I've never used USB so I don't know.

    /Henrik.

Similar Threads

  1. IR trasmitter using PIC 16F84 and NE555
    By tonixxx in forum mel PIC BASIC
    Replies: 1
    Last Post: - 27th December 2012, 00:55
  2. How do I program a pic to accept inputs?
    By timbear3 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd December 2012, 00:35
  3. Replies: 7
    Last Post: - 20th November 2012, 19:41
  4. Which pic? up to date basic chip for 16f877
    By tasmod in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th November 2012, 11:26
  5. How not to prototype your next PIC project
    By SteveB in forum General
    Replies: 3
    Last Post: - 12th November 2012, 09:35

Members who have read this thread : 1

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