Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the 'Configuration Bits' in the PIC16F84

I am using the PIC16F84 in a circuit and I'm programming the assembly for the PIC.  However I can't figure out how to set the configuration bits.  For example I want to select the LP Oscillator, turn the WDT off, turn the PUT on, and turn the CP off.  Normally if I was using the IDE from Microchip I would add the line:
 
_CONFIG H'3FF0'
 
However Multsim does not recognize this as a valid code.  In addition the P16F84.inc file contains the following definitions:
 
_CP_ON                       EQU     H'000F'
_CP_OFF                      EQU     H'3FFF'
_PWRTE_ON                 EQU     H'3FF7'
_PWRTE_OFF                   EQU     H'3FFF'
_WDT_ON                      EQU     H'3FFF'
_WDT_OFF                     EQU     H'3FFB'
_LP_OSC                      EQU     H'3FFC'
_XT_OSC                      EQU     H'3FFD'
_HS_OSC                      EQU     H'3FFE'
_RC_OSC                      EQU     H'3FFF'
 
What is the code though to select which options you want to use?
0 Kudos
Message 1 of 2
(4,828 Views)

Try this code:

 

_CONFIG _CP_OFF & _PWRITE_ON & _WDT_OFF & _LP_OSC

I tried this in the assembler and it didn't return any error messages when compiling. I found this in a PIC Book that I downloaded off the internet.

I hope it works for you. I am new to the MCU Module and learning about it so don't consider me an expert on it by a long shot.

Have A Nice Day

Kittmaster's Component Database
http://ni.kittmaster.com

Have a Nice Day
0 Kudos
Message 2 of 2
(4,815 Views)