How do i set Vref

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

Moderators: Benj, Mods

Post Reply
Tummers
Posts: 3
Joined: Mon Apr 16, 2007 9:52 am
Contact:

How do i set Vref

Post by Tummers »

Hello All,

I want to use the Vref functions of a PIC 16F818 within Flowcode V3 pro.
I added the c-code
adcon0 = 0xC5;
adcon1 = 0x08;

But the PIC doesn't respond to that.
Does anyone have a clue?

Greets Frank.[/img][/list]

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:

Post by Benj »

Hello

You will probably have to rewrite the ADC sample function in the Flowcode FCD file to do this. The FCD file can be found in the Flowcode V3/FCD directory. Open the FCD file for your PIC processor and edit the following line.

ADCCapture =

Make sure to make a backup of your FCD file and also remember that updates and patches for Flowcode may overwrite your edited FCD files so remember to make backups of this also.

Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

Post by Mark »

Tummers,

Rather than overwite the fcd file you can define a new chip. I for example can use 16f876B.fcd by copying 16f876A.fcd with modifications and it appears as a new chip on the Flowcode menu.

This may also have the advantage that any update will presumably not overwite chip names that are not standard.

Mark
Go with the Flow.

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

Post by Steve »

Flowcode gets the name of the chip from the FCD filename itself, so you will need to add something else to the FCD file if you are to do this.

In the [Device] section, add a line similar to the following to define the chip. This will override the name of the FCD file itself.

Code: Select all

ChipName=16F876A

Tummers
Posts: 3
Joined: Mon Apr 16, 2007 9:52 am
Contact:

Post by Tummers »

Ok Thanks,

It works!!

Greets Frank

Post Reply