Continue to Site

# Problem with setting the config bits of PIC16F676 in Assembly

Status
Not open for further replies.

#### chevymn1964

##### Full Member level 2
Hello Everyone! Got a quick question.... Im having problems setting the config bits on a 16F676 in assembly I want to use the internal osc with the ports set as I/O Example: __config _cp_off & _wdt_off & _pwrte_on & _INTOSC_???????
I cant figure out what to put after the _INTOSC Each time I update the project I get an error saying:Error[113] C:\PROGRAM FILES\MICROCHIP\DOCS\PIC DVM 16F676.ASM 33 : Symbol not previously defined (_INTOSC) any Ideas?????
Thanks!

#### 16F676

##### Member level 2
_intrc_osc_noclkout

Code:
_CPD                         EQU     H'3EFF'
_CPD_OFF                     EQU     H'3FFF'
_CP                          EQU     H'3F7F'
_CP_OFF                      EQU     H'3FFF'
_BODEN                       EQU     H'3FFF'
_BODEN_OFF                   EQU     H'3FBF'
_MCLRE_ON                    EQU     H'3FFF'
_MCLRE_OFF                   EQU     H'3FDF'
_PWRTE_OFF                   EQU     H'3FFF'
_PWRTE_ON                    EQU     H'3FEF'
_WDT_ON                      EQU     H'3FFF'
_WDT_OFF                     EQU     H'3FF7'
_LP_OSC                      EQU     H'3FF8'
_XT_OSC                      EQU     H'3FF9'
_HS_OSC                      EQU     H'3FFA'
_EC_OSC                      EQU     H'3FFB'
_INTRC_OSC_NOCLKOUT          EQU     H'3FFC'
_INTRC_OSC_CLKOUT            EQU     H'3FFD'
_EXTRC_OSC_NOCLKOUT          EQU     H'3FFE'
_EXTRC_OSC_CLKOUT            EQU     H'3FFF'

### chevymn1964

Points: 2

#### gdaporta

##### Member level 5
pic16f676perojakt

chevymn1964 said:
Hello Everyone! Got a quick question.... Im having problems setting the config bits on a 16F676 in assembly I want to use the internal osc with the ports set as I/O Example: __config _cp_off & _wdt_off & _pwrte_on & _INTOSC_???????
I cant figure out what to put after the _INTOSC Each time I update the project I get an error saying:Error[113] C:\PROGRAM FILES\MICROCHIP\DOCS\PIC DVM 16F676.ASM 33 : Symbol not previously defined (_INTOSC) any Ideas?????
Thanks!

You are writing in assembly language, I think you are using the MPLAB IDE.

When you are writing in this editor and you want to define something very specific from the device like the fuses, you must open the *.inc file.
In your case you must open the P16F676.INC file. You must find this file in: [Program Folder]\MPASM Suite\P16F676.INC
Look in this file the information under the title ; Configuration Bits

_INTRC_OSC_NOCLKOUT EQU H'3FFC'
_INTRC_OSC_CLKOUT EQU H'3FFD'

So, if you want to use the internal oscilator, you must select one of the two possibilities:

_INTRC_OSC_NOCLKOUT
_INTRC_OSC_CLKOUT

Note that _INTOSC is not defined.

By,

GuillerMo (AR)

### chevymn1964

Points: 2

#### chevymn1964

##### Full Member level 2

Thanks for the help. Its funny how the easy things can put you in a LOOP.... Now if I can figure out how to work the ADC's all would be great! lol

#### gdaporta

##### Member level 5
p16f676.inc

chevymn1964 said:
Thanks for the help. Its funny how the easy things can put you in a LOOP.... Now if I can figure out how to work the ADC's all would be great! lol

Try to do it yourself, if you have any problems first of all make a search in the site, and if no available information about your problem, you could ask via a topic.

By,

GuillerMo (AR)

#### chevymn1964

##### Full Member level 2
pic16f676 a/d converter

Hey everyone! yet I have another problem.... Im trying to figure out how to use the adc on RA0 and then display the result on an lcd in Volts.... I am using ra0-ra3 as inputs and ra4 as an output... portc is set as all outputs for the lcd.... Here is the strange part...... when I run the code in a mplab it will work fine and I can display text on both lines (16x2) with no porblem until i read the adc, convert b2bcd and then display on lcd. Unstead of displaying to portc I can see the trisc bits switching but they should be sent to portc???????

NEVERMIND!!!! Got her working!!!! I was selecting the wrong banks for the resuth &resultl.................

Status
Not open for further replies.