Working out Config words - esp. for other programmers.

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Ian
Posts: 110
Joined: Thu Sep 29, 2005 10:53 am
Location: Matrix Multimedia
Been thanked: 1 time
Contact:

Working out Config words - esp. for other programmers.

Post by Ian »

One handy tip is to use PPP to calculate the config words.
Use the Configure PIC option to open the PPP config screen.
Manually select the chip you want in advanced config mode.
If you have the simple config screen click on the Options button and uncheck 'use simple config'.

You can then change the parameters using the easier drop down option boxes. The corresponding config word(s) are displayed on the left near the bottom. You can then use these values to set the config word(s) in other programmers, or to embed it into your code.

The config words can be displayed in Hex, Binary or Decimal.
You can also edit these config words and they wil lcahnge the drop down boxes to match. This allows you to enter config words you have been given, or have read from a chip, to see what configuration settings they contain.

Chet
Posts: 61
Joined: Thu Oct 13, 2005 5:05 am
Location: USA
Has thanked: 2 times
Contact:

Post by Chet »

I was wondering if any Flowcode users know how to set the programmer config setting in Flowcode to program directly to the chip using the Newfound Warp 13 programmer (PicStart Plus clone)?

Its a pain to have go through MPLAB to burn.

If not, could V3 support this?

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

Post by Steve »

Chet,

I had a quick search about this and found the following:

http://home.pacbell.net/theposts/picmic ... anual.html

It allows a command-line interface to PICstart Plus (and clones), which should work with FlowCode v2. If you have any success on this front, please let the forum know as it could be very useful for other users.

Chet
Posts: 61
Joined: Thu Oct 13, 2005 5:05 am
Location: USA
Has thanked: 2 times
Contact:

Post by Chet »

Steve, thanks for the link. I checked it out. Do you think I should be able to just use the same PICP congfig settings in Flowcode in the programmer setting. Or do I need to install the PICP software as a go between.

Chet

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

Post by Steve »

Hi Chet,

FlowCode v2 does not allow you to embed configuration data into the generated HEX file (although you could use the "#defines" component to do this).

There may be a way of defining and sending the configuration data using the PICP command line, but I am not familiar with it.

I'd suggest using the "#defines" component and putting something like the following into it:

Code: Select all

asm __CONFIG H'3FFA'
(this line gets passed directly to the MPASMWIN assembler. If you are using a 16F88, or another chip with 2 config words, please refer to the MPASM documentation).

Your command line for PICP in FlowCode's config options screen will probably be something like:

Code: Select all

C:\picp\picp.exe -c com1 %p -wp 
(FlowCode puts the name of the hex file at the end of this string).

rvogel
Posts: 21
Joined: Mon Sep 18, 2006 11:20 pm
Contact:

Post by rvogel »

I am using MicroPro to program my PICs from FlowCode and it is working good. Is there a way to set the configuration bits in FlowCode so I don't have to keep setting the fuses in MicroPro? By default it comes up with RC for the Oscillator which I then set to XT.

In the MPASM help file it has a topic covering "__config - Set Processor Configuration Bits". Does this apply here and how do I implement?

Thanks.
rvogel

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

Post by Steve »

Yes, the same advice applies here. In v2 of FlowCode, use the "#defines" component and add an appropriate __CONFIG line as described above.

For those using v3 (which is not many yet because it is not quite ready for release!), the configuration data now gets stored in the FlowCode file and should transfer ok to the HEX file. The programmer should pick the info up from the HEX file, so you should not need to do anything.

rvogel
Posts: 21
Joined: Mon Sep 18, 2006 11:20 pm
Contact:

Post by rvogel »

I have tried the #defines component with this code:

Code: Select all

asm __CONFIG XT_OSC
but it doesn't carry over to MicroPro and I don't see it in the asm file. What am I doing wrong?
rvogel

rvogel
Posts: 21
Joined: Mon Sep 18, 2006 11:20 pm
Contact:

Post by rvogel »

I just got it to work by inserting a C Code block at the beginning of the chart:

Code: Select all

asm __CONFIG _XT_OSC
but it does not work with the #Defines component.

Sorry, I am a bit green with C. Most of my experience is in Visual Basic on a PC.

Is there anything wrong with doing it as pasted in C Code? How would I get it to work with #Defines?

Thanks.
rvogel

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

Post by Steve »

I think you need to call the "AddDefines" macro from within your program - this tells FlowCode that the component is being used and needs to be included in the compiled code.

Post Reply