# Configuration Word Generator for 627A/628A/648A

Status
Not open for further replies.

#### jakeselectronics

##### Member
Hey everyone,

Thanks to dougy83 for the help to finalise the code.

Take a look...
https://www.jakeselectronics.net/index.php
Follow the link to my website, then navigate to tools and the various generators are listed there.

If you are a PIC user/programmer, would you ever use something like this?

Last edited:

#### Pommie

##### Well-Known Member
Had a look and it's good but I hate the config 0xnnnn type instruction. You should change it so that it uses the labels in the include file.

For example,
Code:
	__config _INTRC_OSC_NOCLKOUT & _PWRTE_ON & _BODEN_ON & _MCLRE_OFF & _WDT_OFF & _CP_OFF

From the above I can see what is turned on/off.

On the other hand,
Code:
	__config 0b10101010011
means nothing to me.

Sorry to be unsupportive but this is a little bugbear of mine.

However, if you change it to produce the Microchip preferred version then I'll point people to your site.

Mike.

#### Mike - K8LH

##### Well-Known Member
As someone who has been wanting to write a Config' Helper app' for a long time, I commend you for your effort but I'm afraid I have to agree with Pommie.

If I ever do get around to writing that app' it will have radio buttons to select the type of output formatting (assembler, MCC18, BoostC, others.) and a button to copy that text to the clipboard for insertion into the source file. And hey, if you want to take up the cause, that would be great.

Kind regards, Mike

#### jakeselectronics

##### Member

It may take a little time as I struggle with Javascript

Thanks for the input

#### jakeselectronics

##### Member
Alright.. Its taken 2 hours and 10 minutes...
And i've managed to include 'Microchip preferred version'

I want to do more, but I'm learning by trial and error. So the progress is slow as I do not know much about javascript at all.

Take another look; Jake's Electronics | Kits, Tutorials, Projects and More.

I have 2 problems...
1. What is the 'Microchip preferred version' for the "LVP: Low Voltage Programming Enable" (_LVP_XX???????????)
2. For the oscillator, "011 = EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN"...
What is EC? What is the 'Microchip preferred version' for that?
I couldn't seem to find it on page 503 of the https://ww1.microchip.com/downloads/en/DeviceDoc/33023a.pdf

#### Nigel Goodwin

##### Super Moderator
Check the include file for each chip you're using, the definitions are declared there.

#### Pommie

##### Well-Known Member
Very well done,

The Microchip values can be found in file P16F628A.INC which you will find in C:\Program Files\Microchip\MPASM Suite , they are,
Code:
_BODEN_ON                    EQU     H'3FFF' ;Backwards compatability to 16F62X
_BODEN_OFF                   EQU     H'3FBF' ;Backwards compatability to 16F62X
_BOREN_ON                    EQU     H'3FFF'
_BOREN_OFF                   EQU     H'3FBF'
_CP_ON                       EQU     H'1FFF'
_CP_OFF                      EQU     H'3FFF'
_DATA_CP_ON                  EQU     H'3EFF'
_DATA_CP_OFF                 EQU     H'3FFF'
_PWRTE_OFF                   EQU     H'3FFF'
_PWRTE_ON                    EQU     H'3FF7'
_WDT_ON                      EQU     H'3FFF'
_WDT_OFF                     EQU     H'3FFB'
_LVP_ON                      EQU     H'3FFF'
_LVP_OFF                     EQU     H'3F7F'
_MCLRE_ON                    EQU     H'3FFF'
_MCLRE_OFF                   EQU     H'3FDF'
_RC_OSC_CLKOUT               EQU     H'3FFF'
_RC_OSC_NOCLKOUT             EQU     H'3FFE'
_ER_OSC_CLKOUT               EQU     H'3FFF' ;Backwards compatability to 16F62X
_ER_OSC_NOCLKOUT             EQU     H'3FFE' ;Backwards compatability to 16F62X
_INTOSC_OSC_CLKOUT   	     EQU     H'3FFD'
_INTOSC_OSC_NOCLKOUT         EQU     H'3FFC'
_INTRC_OSC_CLKOUT   	     EQU     H'3FFD' ;Backwards compatability to 16F62X
_INTRC_OSC_NOCLKOUT	     EQU     H'3FFC' ;Backwards compatability to 16F62X
_EXTCLK_OSC                  EQU     H'3FEF'
_HS_OSC                      EQU     H'3FEE'
_XT_OSC                      EQU     H'3FED'
_LP_OSC                      EQU     H'3FEC'

So, again, well done, rep++.

Mike.

#### jakeselectronics

##### Member
arr thanks nigel and mike,

I looked for that but went to the wrong directory in MPLAB.

Ok, I've smoothed out the errors, I think... I just need a couple of people to give it a quick check;
https://jakeselectronics.x10hosting.com/b.php
once it's error free, i will create a propper link to it from my page.

Thanks for all the input and help...

Oh another thing, Are you happy with the defaults?

Last edited:

#### ericgibbs

##### Well-Known Member
Check the include file for each chip you're using, the definitions are declared there.

This is the way I create a CONFIG when using a new PIC.

Copy and Paste all the CONFIG's for the PIC's you use most into a 'Headers.txt' file.
Doing it this you can also add the PIC type include, list and error level files to the Header.txt file.

A quick copy/paste to a new program, edit as required and you can start writing the program.

#### Mike - K8LH

##### Well-Known Member
Oh wow! Very nice!

Can you do the other hundred or so PIC devices for us all now, please (grin).

Kind regards, Mike

Last edited:

#### jakeselectronics

##### Member
haha i thought that when i was half way through...
I will probably do the ones i commonly experiment with...
16F877, 16F737, 12F629...
then If there are any popular requests...

Anyways, new permentant link for those who might see this post in the future...

PIC16F627A/628A/648A Configuration Word Generator

#### atferrari

##### Well-Known Member
Jake,

All I can see from your page is a dark black background and faint white letters that I hardly could read. Is that normal?

#### jakeselectronics

##### Member
The page is not 100% black and the writing should be clearly visibale and reabable.
If it appears dark and hard to read, i'd say your monitor is darker than everyone elses.

#### Nigel Goodwin

##### Super Moderator
I would agree with Eric, the colour choices are very bad giving poor readability.

#### jakeselectronics

##### Member
This is a somewhat old thread of mine, but I've updated the link the opening post in case anyone stumbles across this page through a google search or something.
I've also taken many peoples advice of changing the color scheme of the site to pretty much black on white, and I like it.

Status
Not open for further replies.

Replies
4
Views
2K
Replies
2
Views
3K
Replies
2
Views
1K
Replies
3
Views
8K
Replies
3
Views
3K