Interrupt / ADC / Voltage

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
helesmes
Flowcode v5 User
Posts: 15
Joined: Thu Dec 01, 2011 6:33 pm
Location: France / Nord
Has thanked: 3 times
Contact:

Interrupt / ADC / Voltage

Post by helesmes »

Hello,

I am Michel in the North of France.

Can you help me?

I allow requesting you for a problem Flowcode, more particularly: the interruptions.
In Flowcode as attachment, the interruption is activated by an outside sensor ( a switch).

What I wish to make and which raises me problem, I would like to replace this switch by one potentiometer.

I have the chain of the operations, but I do not know how to make, but:

1) Is this possible to activate an interruption by a tension treated in the pic with the ADC Macro?
2) What pic to choose ( 12Fxxx, 16Fxxx or 18Fxxx) ?

Then:

- I attribute an entry of Analog conversion and I affect a variable; U_Var
- I attribute a reference size; U_Seuil
- I compare U_Var and U_Seuil
- According to the result of this comparison, I continue in the main program or I parts in the program of interruption.

Thank you.
Regards
Michel

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Interrupt / ADC / Voltage

Post by medelec35 »

Hi Michel,
Not sure how easy it would be.
Not sure if you can have ADC and IOC on the same pin at the same time.
Perhaps the way is not have pin set for ADC just set it as port IOC.
You can have a high value trimmer connected between IOC pin and GND,
trimmer can be preset so if voltage below required trigger value then voltage on pin is at logic 0
When voltage on pin rises then when i/p goes from logic 0 to logic 1, IOC is triggered.

You can perhaps consider using the comparator feature of microcontroller instead of pin as IOC input?
I don't believe there is a comparator component within Flowcode so for that you will need to use C code to enable comparator + interrupt.

Martin
Martin

helesmes
Flowcode v5 User
Posts: 15
Joined: Thu Dec 01, 2011 6:33 pm
Location: France / Nord
Has thanked: 3 times
Contact:

Re: Interrupt / ADC / Voltage

Post by helesmes »

Hello Medelec.

Thank you for your answer.

Michel.

Post Reply