PIC16F1937 reference voltage for A/D-conversion

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

Moderator: Benj

Post Reply
Uhrenfan
Posts: 5
Joined: Thu May 15, 2014 10:58 am
Been thanked: 1 time
Contact:

PIC16F1937 reference voltage for A/D-conversion

Post by Uhrenfan »

The PIC16F1937 has selectable 1.024/2.048/4.096V voltage references on chip.
How can I use these stable values in FC8 ?
When I start a project with this chip and open the "properties-settings"- window there is no option to implement these values.
Is it necessary to implement C-Code ?

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: PIC16F1937 reference voltage for A/D-conversion

Post by Benj »

Hello,

In the ADC component properties it should be possible to assign the FVR as the VREF option.

Currently you do need a C-code icon to setup the voltage of the FVR module but this should be fairly straightforward.

Configure for 1.024V

Code: Select all

FVRCON = 0x81;
Configure for 4.096V

Code: Select all

FVRCON = 0x83;
Let us know how you get on.

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: PIC16F1937 reference voltage for A/D-conversion

Post by STibor »

Hello,

Have you planned to expand the ADC component of other types of controllers with FVR?
For example: Arduino Nano, Uno, Mega, PIC12F1822

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: PIC16F1937 reference voltage for A/D-conversion

Post by Benj »

Hello,
Have you planned to expand the ADC component of other types of controllers with FVR?
For example: Arduino Nano, Uno, Mega, PIC12F1822
No plans but as it was quick to do these are all done now and available on the update system.

Uhrenfan
Posts: 5
Joined: Thu May 15, 2014 10:58 am
Been thanked: 1 time
Contact:

Re: PIC16F1937 reference voltage for A/D-conversion

Post by Uhrenfan »

Hello Benj,
thank you for your precise advice.
I opened a C-Window, defined the VFRCON-Register with the proposed values, compiled and the result ist perfect.
You must know, that I am 78 years old and not very familiar with C-Code. That is the reason why I use FC. That means, for special problems I need your advice.

Another Question: In older Version of FC (until V5) there was under properties a section "customer code" which could be modified if necessary.
This is very interesting, e.g. for implementing of vref+ and vref- to get higher resolution in a special voltage area. I can not find this section in the new versions (starting with V6).
Please can you tell me, where I can find it now ?


With kind regards


P. A. Moser, Linz, Austria

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC16F1937 reference voltage for A/D-conversion

Post by LeighM »

In older Version of FC (until V5) there was under properties a section "customer code" which could be modified if necessary
You are correct, later versions do not have this custom code feature.
But C code can be included with the C icon, also users can create their own components, including C code routines.

Post Reply