"Write config on download" -- meaning/use

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
gtc
Posts: 69
Joined: Mon Mar 23, 2015 5:34 am
Has thanked: 30 times
Been thanked: 15 times
Contact:

"Write config on download" -- meaning/use

Post by gtc »

Version 6.1.2.0

In Project Options --> Configure there's a tick box for "Write config on download", which appears to be unticked by default.

What does that do, and when should I use it?

(No mention of this feature in the associated Wiki page text, only a screenshot showing it ticked.)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: "Write config on download" -- meaning/use

Post by Benj »

Hello,

The option specifies if the config settings are added to the output hex file or not. If they are not added then the current config settings will be retained when reprogramming your device.

For a PIC, dsPIC etc the config memory is the same as the program memory and so the config can be reprogrammed again and again.

For an AVR the config memory can only be changed a few times and so the tick box allows you to disable the programming of the config settings when re-programming the same device multiple times.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: "Write config on download" -- meaning/use

Post by QMESAR »

Benj wrote: For a PIC, dsPIC etc the config memory is the same as the program memory and so the config can be reprogrammed again and again.

For an AVR the config memory can only be changed a few times and so the tick box allows you to disable the programming of the config settings when re-programming the same device multiple times.
Just one of the many reasons why a PIC is a better Micro Controller than any AVR :D :D

gtc
Posts: 69
Joined: Mon Mar 23, 2015 5:34 am
Has thanked: 30 times
Been thanked: 15 times
Contact:

Re: "Write config on download" -- meaning/use

Post by gtc »

Benj wrote:Hello,

The option specifies if the config settings are added to the output hex file or not. If they are not added then the current config settings will be retained when reprogramming your device.
Thank you.

So for a PIC device (e.g. 16F88), if I don't tick that box, then no config settings will be included in the hex file?

Also, would your Wiki maintainer kindly add your description to the Project Options page.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: "Write config on download" -- meaning/use

Post by Benj »

Hello,
So for a PIC device (e.g. 16F88), if I don't tick that box, then no config settings will be included in the hex file?
That is correct. You can see if the config data is included or not by looking near the top of the Flowcode C file.

Might look something like this for an 8-bit PIC.

Code: Select all

#ifdef _BOOSTC
#pragma DATA 0x2007, 0x3F62
#endif
#ifdef HI_TECH_C
__CONFIG(0x3F62);
#endif
#ifdef _BOOSTC
#pragma DATA 0x2008, 0x3FFE
#endif
#ifdef HI_TECH_C
__CONFIG(0x3FFE);
#endif
Also, would your Wiki maintainer kindly add your description to the Project Options page.
This should now be done.

Post Reply