ADC module, about FVR option

Moderator: Benj

Post Reply
User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

ADC module, about FVR option

Post by psf »

Hi, I need to select the FVR option on a PIC; in ADC conversion I want to enable the Fixed internal Voltage Reference but in ADC component settings I can select only VDD or Vref (external input). Reading datasheet I discovered that setting bit 0 of ADCON1 register, FVR will be enabled. How can I resolve this problem? (I try to join everywhere a simple opcode but nothing.....)
Thanks in advace.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: ADC module, about FVR option

Post by Enamul »

Hi,
Please mention in which PIC you want to have this facility..I can modify the C file for you..
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: ADC module, about FVR option

Post by psf »

Enamul wrote:Hi,
Please mention in which PIC you want to have this facility..I can modify the C file for you..
Enamul
16LF1906 (note that also datasheet are wrong for this new chip, in adcon1 register they report this combination as "reserved" but in other section of file FVR is present)

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: ADC module, about FVR option

Post by Enamul »

Hi,
Are you sure PIC 16LF1906? FC doesn't support that PIC ....
16LF1906 (note that also datasheet are wrong for this new chip, in adcon1 register they report this combination as "reserved" but in other section of file FVR is present)
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: ADC module, about FVR option

Post by psf »

It's the same of 16LF1903, I just modified FCD with the double amount of program memory... But I think the problem is on ADC module, I try to modify the "C" custom code, but as I don't know NOTHING about "C" ....

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: ADC module, about FVR option

Post by Enamul »

Hi,
I am having a look and will let you know..
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: ADC module, about FVR option

Post by Enamul »

Hi,
Looking at the PIC_CAL_ADC.c file in component folder seems that it has to be changed quite a lot as FC is saying 16LF1903 as TYPE23 if you generate C code in FC you will see that in the beginning of pg. But in type 23 the chip is not included..in Type 23 two chips are 16F1826-27 which has FVR but not same setting like 1903..so I think we have to modify there or may be need to create a different type..
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
psf
Posts: 45
Joined: Mon Jun 25, 2007 9:44 pm
Location: Italia
Has thanked: 6 times
Been thanked: 2 times
Contact:

Re: ADC module, about FVR option

Post by psf »

Enamul wrote:Hi,
Looking at the PIC_CAL_ADC.c file in component folder seems that it has to be changed quite a lot as FC is saying 16LF1903 as TYPE23 if you generate C code in FC you will see that in the beginning of pg. But in type 23 the chip is not included..in Type 23 two chips are 16F1826-27 which has FVR but not same setting like 1903..so I think we have to modify there or may be need to create a different type..
Enamul
THANKS but I have some trouble even with I2c software routine, It shouldn't work on any chip? This one doesn't have SSPIF flag on PIR1 so compiler just stops in error.

Post Reply