18F4620 Fuses configuration


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54

    Question 18F4620 Fuses configuration

    Hello,

    I need help to insert some fuses configurations in my program !
    Today my program is OK but only with 4MHZ cristal, because it is the default of PBP. However, I would like to use a 20MHZ cristal and also change WDT and BOR fuses to OFF.
    Please, can somebody help me ? I am using a USB programmer, but diferent of ICPROG, I can not to change the fuses in moment of programation. I want to insert it in my PBP code.

    I have been used it with sucess to 16F628A for example, inserting :
    @ DEVICE pic16F628a, HS_OSC ' System Clock Options
    @ DEVICE pic16F628a, WDT_OFF ' Watchdog Timer
    @ DEVICE pic16F628a, PWRT_OFF ' Power-On Timer
    @ DEVICE pic16F628a, BOD_OFF ' Brown-Out Detect
    @ DEVICE pic16F628a, MCLR_ON ' Master Clear Options (External)
    @ DEVICE pic16F628a, LVP_OFF ' Low-Voltage Programming
    @ DEVICE pic16F628a, CPD_OFF ' Data Memory Code Protect
    @ DEVICE pic16F628a, PROTECT_OFF ' Program Code Protection

    Now I want to do it with 18F4620!!!

    Thanks

    Pimentel

  2. #2
    Join Date
    Aug 2008
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    You can use back the previous code. Just replace pic16F628a with pic18F4620.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Not quite right Pic2008...

    18F PICs require you to use the MPASM Assembler... and MPASM does not recognise the @ DEVICE syntax that configures the Config Fuses in the same way that the default PM Assembler does. Here is an example for a PIC18F2420...

    Code:
    	'
    	'	PIC Defines for PIC18F2420
    	'	==========================
    
    	@ __CONFIG    _CONFIG1H, _IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_XT_1H
    							' Oscillator Switch-over Disabled
    							' Fail-Safe clock Monitor Disabled
    							' Set for external XT Oscillator RA6 & RA7 disabled
    	@ __CONFIG    _CONFIG2L, _BOREN_OFF_2L & _PWRT_ON_2L & _BORV_0_2L
    							' Brown-Out Reset Enabled
    							' Power-On Timer Enabled
    							' Brown-Out Trip set to 4.2v
            @ __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    							' WatchDog is ON
    							' Watchdog Postscaler set to 1:128
    	@ __CONFIG    _CONFIG3H, _MCLRE_ON_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
    							' MCLR is ON (external) PortE.3 is DISABLED
    							' PortB 4:0 is digital on Reset
    							' CCP2 is Multiplexed with PortC.1
            @ __CONFIG    _CONFIG4L, _STVREN_ON_4L & _XINST_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    							' Stack Under/Overflow will Reset System
    							' Enhanced CPU Addressing Disabled
    							' Low-Voltage Programming is OFF
    							' DEBUG is Disabled
    	@ __CONFIG    _CONFIG5L, _CP1_ON_5L & _CP0_ON_5L
    							' All Code Protect
            @ __CONFIG    _CONFIG5H, _CPB_ON_5H & _CPD_ON_5H
    							' EEPROM is Code Protected
    							' Boot Block code is Code Protected

  5. #5
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54


    Did you find this post helpful? Yes | No

    Smile Config ok!

    Hello,

    Sorry about my delay! I tested the example of Melanie and now with sucess.
    Thank you

    Pimentel

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. meProg configuration vs setting fuses in code
    By AndrewC in forum General
    Replies: 2
    Last Post: - 10th June 2008, 14:00
  3. Coding Style - PIC 18F4620 config fuses
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th January 2008, 20:05
  4. 18f4620 Configuration bits
    By Raflex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th September 2006, 20:32
  5. configuration fuses
    By mischl in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th April 2005, 10:50

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