Swapping Compiler and Programmer Settings in Flowcode

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Post Reply
User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Swapping Compiler and Programmer Settings in Flowcode

Post by Steve »

Recently, we have had quite a few requests to make it easy to swap between various Flowcode toolchain settings. For example, a user may wish to test out the HI-TECH compiler without erasing their current settings; or they may use a variety of hardware boards which each need a separate programming interface and find that it’s not convenient to change these settings by hand each time.

A future version of Flowcode may well come with the ability to switch between 2 or more alternative settings, but this does not solve the immediate problem in the current version of Flowcode. This article explains step-by-step how to create these various settings and save them as separate registry scripts that will swap between settings at the click of a button.

Flowcode's Windows Registry Settings
Before we start, I will add an important warning – editing the wrong part of the registry can have major consequences to the stability of your applications and of Windows itself. So when editing (or even looking at) the registry, be extremely careful and read any warnings before proceeding.

As is common with many Windows applications, Flowcode uses the Windows Registry to store data between sessions. When Flowcode is installed, defaults and other system-wide settings are stored in an area of the registry called HKEY_LOCAL_MACHINE. It is very important that this area is not altered unless you know exactly what you are doing, so we will not touch this part of the registry.
The section of the registry we will be looking at is where the per-user settings are stored. This is called HKEY_CURRENT_USER. The technique described in this article applies to all versions of Flowcode, but we will specifically concentrate on the Flowcode for PICmicros V4 version. In this version, the registry location for Flowcode’s compiler settings is:
HKEY_CURRENT_USER\Software\matrixmm\FlowcodeV4\Compiler
To access the registry, we will use a tool built in to Windows called “RegEdit”. To run this, type RegEdit in the “Run…” or “Search…” window (accessed via the “Start” button of Windows):

Image

Once RegEdit has opened, you need to find the appropriate location for Flowcode’s settings. It should be fairly easy to find – the contents of the registry are displayed in a similar way to folders in Windows Explorer. Here’s an image of the correct location in the registry:

Image

Creating the Registry Scripts
It is actually very simple to create the registry scripts that we will use to swap the Flowcode settings. Simply right-click on the “Compiler” node in the left-hand pane, select “Export…” and then save the file with an appropriate name – for example “BoostC&PPP.reg”. In my case, this has saved the default Flowcode settings. Next we will create some alternative settings and save these.

Open Flowcode, select a new blank program (it does not matter which target you select) and open the “Compiler Options” window from the “Chip” menu. You can now edit this so it uses alternative settings.

Image

I will alter the programmer settings so Flowcode can use the PICkit2 interface. To do this, change the Programmer Location and Programmer Parameters appropriately (the appropriate settings for PICkit2 are here). Press “OK” on the Compiler Options window to save the settings.

To save these settings to a registry script, go back to RegEdit and click “View..Refresh”. You will now see the new settings stored in the registry. Export these again by right-clicking the “Compiler” entry and save these as “BoostC&PICkit.reg”.

Applying the Settings to Flowcode
Once the registry scripts have been saved, swapping between the settings is very easy. Simply double-click the appropriate settings file and click “Yes” when Windows asks you if you are sure:

Image

The settings will be immediately transferred, so there is no need to close and restart Flowcode.

Taking this Further
This article has shown how easy it is to create your own registry scripts for alternative programmer settings. In a similar way, you can create custom settings with certain compiler options active (e.g. without the floating point library) or for a whole new compiler (see the Hi-TECH compiler article here).

Post Reply