PIC12f609 use GP0 and GP1 ad digital input

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Albert38
Posts: 23
Joined: Mon Jan 18, 2010 8:40 am
Has thanked: 2 times
Contact:

PIC12f609 use GP0 and GP1 ad digital input

Post by Albert38 »

Hello,

I have trouble using GP0 and GP1 as digital input on the pic12f609. After reading the datasheet I found a possible error in the FCD file that belogs to this chip.
Am I right that the line containing Initialise="" must be Initialise="ansel = 0;\n" to use GP0 and GP1 as digital input ?

Or is there an other way to configure the chip in flowcode leaving the FCD file origional ?

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: PIC12f609 use GP0 and GP1 ad digital input

Post by Benj »

Hello,

Yes you can modify the FCD file to include the line.

Initialise="ansel = 0;\n"

You will need to close and reopen the flowcode file for the FCD changes to be read.

Or you can ad the following line of C code to the start of your program.

ansel = 0;

I have modified the default FCD for future versions of Flowcode.

Albert38
Posts: 23
Joined: Mon Jan 18, 2010 8:40 am
Has thanked: 2 times
Contact:

Re: PIC12f609 use GP0 and GP1 ad digital input

Post by Albert38 »

By the way there are a lot more PIC chips that have these setting by default on Comparator.

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: PIC12f609 use GP0 and GP1 ad digital input

Post by Benj »

Hello Albert,

Yes this chip must have somehow made it through the net when we were updating the FCD files. Most of the devices already switch off the comparitor and analogue functionality by default on startup so you do not have to manually do it. I have also updated the 12F609 FCD file so that this mod will be included in the next release.

Post Reply