Help with config fuse?


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52

    Default Help with config fuse?

    I'm confused about the config or fuses or whatever they are. Doesn't the @ mean that an asm code follows?
    Do I always need to include the IC file? Like 12F675.inc?
    I've seen some done in caps and some not. The PBP manual mentioned something about different assemblers needing caps.
    Also some are entered in a single line like this:

    @ DEVICE pic12f675, intrc_osc_noclkout, wdt_off, pwrt_on, mclr_off, bod_off, protect_off

    and some on individual lines like this:

    @ DEVICE pic16F628, INTRC_OSC_NOCLKOUT
    @ DEVICE pic16F628, WDT_ON
    @ DEVICE pic16F628, PWRT_ON
    @ DEVICE pic16F628, MCLR_OFF
    @ DEVICE pic16F628, BOD_ON
    @ DEVICE pic16F628, LVP_OFF
    @ DEVICE pic16F628, CPD_OFF
    @ DEVICE pic16F628, PROTECT_OFF

    Does it matter which I use?
    Last edited by polymer52; - 25th December 2009 at 17:19.

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


    Did you find this post helpful? Yes | No

    Default

    http://www.picbasic.co.uk/forum/showthread.php?t=543

    when setting the fuses in code space you will need to comment a couple lines in the PIC's Inc file. While you are doing that look at how the fuses are set(single line, double line). Simetimes it does not matter but sometimes it does. Depends on the PIC.

    So looking at how it is done in the Inc is the best way to know.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by polymer52 View Post
    I'm confused about the config or fuses or whatever they are.
    I too had problems assimilating how to best define the config settings in my code when I was new to PicBasic. Of the many suggestions I received from members of this forum, the one that stuck with me as the best way is as shown in the following example, where the config settings are part of an assembly list of statements. By going to the data sheet for the PIC you are using, you can find how to define these statements...these in this example are for an 18F4550, including alternative methods using @ config or
    @ _config statements:
    Code:
    ;--- if you un-comment these, you must comment the ones in the .inc file--
    ASM ; 18F2550/4550, 8mhz crystal
       __CONFIG    _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L
       __CONFIG    _CONFIG1H, _FOSC_HSPLL_HS_1H
       __CONFIG    _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
       __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
       __CONFIG    _CONFIG3H, _PBADEN_OFF_3H ; PortB resets as digital
       __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    ENDASM
    ' If 16F877 MCU used, use this config
    '@ config XT_osc, wdt_off, pwrt_on, protect_off
    '                  or
    '@ _CONFIG _CONFIG1H,_OSCS_OFF_1H & _HS_OSC_1H

  4. #4
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    when setting the fuses in code space you will need to comment a couple lines in the PIC's Inc file. While you are doing that look at how the fuses are set(single line, double line). Simetimes it does not matter but sometimes it does. Depends on the PIC.

    So looking at how it is done in the Inc is the best way to know.
    So if I add the comments in the program I need to comment out everything in the inc file OR make a backup and just change the inc file and leave it out of the program?

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


    Did you find this post helpful? Yes | No

    Default

    Only comment out the lines in the inc file that have to do with the configs(fuses). The other stuff is still needed.

    Yes or. If you do not plan on changing the settings often the just modify the inc.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Only comment out the lines in the inc file that have to do with the configs(fuses). The other stuff is still needed.

    Yes or. If you do not plan on changing the settings often the just modify the inc.
    Thanks to all.

Similar Threads

  1. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 01:48
  2. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 23:51
  3. Error 0X0000008E when connecting a 18F2550 USB HID
    By FranciscoMartin in forum USB
    Replies: 8
    Last Post: - 16th October 2008, 17:20
  4. PortE problems (PIC18F4455)
    By RubenR in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th July 2006, 15:26
  5. Installation sequence
    By Demon in forum General
    Replies: 23
    Last Post: - 11th July 2006, 03:56

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