PDA

View Full Version : 18F4620 Fuses configuration



Pimentel
- 7th September 2008, 12:51
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

Pic2008
- 7th September 2008, 13:59
You can use back the previous code. Just replace pic16F628a with pic18F4620.

Bruce
- 7th September 2008, 16:24
See this thread http://www.picbasic.co.uk/forum/showthread.php?t=543

Melanie
- 7th September 2008, 17:17
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...



'
' 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

Pimentel
- 4th October 2008, 13:23
Hello,

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

Pimentel