Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

config;???

Status
Not open for further replies.

Joe G

Member
I'm starting to learn a little assembly??? but i think i had to much turkey, but what and where does the 0x3D18 relate to for the osc type, i've been reading so much my brain became cranberry sause this week :)
__config 0x3D18;sets the configuration settings


thank you
 
J.

Appears to be Int. Osc. with I/O on RA6, I/O on RA7 ........ ie Bit 4 = 1, Bit 1 = 0, Bit 0 = 0;

Page 98 of the 16F628A data sheet

D.

Oops too slow typing ....
 
Last edited:
thanks alot. I've been reading that data sheet all this time, i knew it was there but couldn't find it yet, but i also learned a bit more, now if
i can just remember it tomorrow lol. thanks again :)
 
I used to use the hex shortcut for CONFIG but it makes the program harder to read later. Better to use the full text. This ones for a 16F88 but yours will be similar.
Code:
__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO
 
Hey Bill,

The 16F88 actually has two config fuse memory locations. And if you examine the fuse settings carefully you'll realize you can shorten the lines by eliminating the "default" settings.

Regards...

Code:
        __CONFIG  _CONFIG1, _LVP_OFF&_PWRTE_ON&_WDT_OFF&_HS_OSC
        __CONFIG  _CONFIG2, _IESO_OFF&_FCMEN_OFF
;
;       _CP_OFF                 ; default, no code protect
;       _CCP1_RB0               ; default, CCP1 on RB0 pin
;       _DEBUG_OFF              ; default, debug mode off
;       _WRT_PROTECT_OFF        ; default, write protect off
;       _CPD_OFF                ; default
;       _LVP_OFF                ; -- low voltage programming off
;       _BODEN_ON               ; default, brown out detect on
;       _MCLR_ON                ; default,
;       _PWRTE_ON               ; -- power up timer enabled
;       _WDT_OFF                ; -- watch dog timer off
;       _INTRC_IO or _HS_OSC    ; -- HS oscillator
;
 
Hey Bill,

The 16F88 actually has two config fuse memory locations. And if you examine the fuse settings carefully you'll realize you can shorten the lines by eliminating the "default" settings.

Regards...

Code:
        __CONFIG  _CONFIG1, _LVP_OFF&_PWRTE_ON&_WDT_OFF&_HS_OSC
        __CONFIG  _CONFIG2, _IESO_OFF&_FCMEN_OFF
;
;       _CP_OFF                 ; default, no code protect
;       _CCP1_RB0               ; default, CCP1 on RB0 pin
;       _DEBUG_OFF              ; default, debug mode off
;       _WRT_PROTECT_OFF        ; default, write protect off
;       _CPD_OFF                ; default
;       _LVP_OFF                ; -- low voltage programming off
;       _BODEN_ON               ; default, brown out detect on
;       _MCLR_ON                ; default,
;       _PWRTE_ON               ; -- power up timer enabled
;       _WDT_OFF                ; -- watch dog timer off
;       _INTRC_IO or _HS_OSC    ; -- HS oscillator
;

Thanks for the post I never thought about just putting what you needed to change I always wrote the whole thing.
 
thanks again all. i've been learning alot more, i must of read that data sheet 0xff times this week, i'm still trying to figure out how to get those numbers,???
 
in such cases i used to place the hex on winpic800 after selecting the chip and seeing the setting page, it reveals all the settings.
likewise while .asm file, on mplab also configuration reveals the settings once you select thee device. YES, experts are right that we should slowly get the habit of defining as elaborated by Blueroomelectronics.
 
Last edited:
I would name your configures but if you want to see how you get 0x0XXX what ever here how you do it find your page like the one I attached go to the bottom of the page
and start with bit O write it down go back up the list till you get to bit 13 you'll end up
10000100010101 = 0x2115
 

Attachments

  • config2.PNG
    config2.PNG
    113.6 KB · Views: 161
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top