Vref-
Moderator: Benj
- 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: Vref-
Hello,
In a C icon you can use this code.
Note that the ADC CAL will probably overwrite your adcon1 setting, looking at the code yes it does.
The 18F4550 uses ADC type 13 so if you look at the file "Flowcode 6/CAL/PIC/PIC_CAL_ADC.c" in a text editor you will see that ADC type 13 starts around line 1683.
Inside the ADC Type 13 look for the line
Before this line add your altered code.
Then the VREF- will get switched on for you by the ADC component.
Please note that a text editor will be unable to save the file if Flowcode is located inside the Program files directory. Instead you will have to save the file to your desktop and then manually copy it back into position using Windows explorer.
We recommend you make a backup of the original file so you can revert back if you need to.
In a C icon you can use this code.
Code: Select all
set_bit(adcon1, 5);
The 18F4550 uses ADC type 13 so if you look at the file "Flowcode 6/CAL/PIC/PIC_CAL_ADC.c" in a text editor you will see that ADC type 13 starts around line 1683.
Code: Select all
#ifdef MX_ADC_TYPE_13
Code: Select all
old_tris = *tris_reg; //store old tris value, and set the i/o pin as an input
Code: Select all
set_bit(adcon1, 5);
Please note that a text editor will be unable to save the file if Flowcode is located inside the Program files directory. Instead you will have to save the file to your desktop and then manually copy it back into position using Windows explorer.
We recommend you make a backup of the original file so you can revert back if you need to.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel