PIC18F25Q10 ADC Vref

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

Moderator: Benj

dz28
Posts: 60
Joined: Thu Aug 04, 2016 3:30 pm
Has thanked: 7 times
Been thanked: 9 times
Contact:

PIC18F25Q10 ADC Vref

Postby dz28 » Wed Dec 04, 2019 3:04 am

Is there an easy way to set the PIC18F25Q10 ADC Vref to the internal FVR_buffer1 (ADPREF register) ?
1.024, 2-048 or 4.096V
I only see options for Vdd and Vref+ pin

Am I missing something or will this require a Ccode block or some initialization code.

Thanks,
Dave

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4362 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby Benj » Wed Dec 04, 2019 12:17 pm

Hi Dave,

I've had a look and it seems the ADC for the Q10 devices was fairly broken as it's a totally new ADC register setup. I've had a good go at fixing it now and adding support for the FVR VREF option. I've now pushed the changes to the update system.

You will just need a C code icon to setup the FVR to a certain voltage. Pick one of the lines below.

Code: Select all

FVRCON = 0x81;   //FVR = 1.024V
FVRCON = 0x82;   //FVR = 2.048V
FVRCON = 0x83;   //FVR = 4.096V


Let me know how you get on.

dz28
Posts: 60
Joined: Thu Aug 04, 2016 3:30 pm
Has thanked: 7 times
Been thanked: 9 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby dz28 » Wed Dec 04, 2019 5:01 pm

Ben,

As usual thank you for the quick response on this!
I got the update and the FVR option is now there.

I am getting the following error when I compile to HEX for a simple project.
Project attached.


0: (500) undefined symbols:
_FC_CAL_ADC_Disable(LCDisplay1.obj) _FC_CAL_ADC_Sample(LCDisplay1.obj) _FC_CAL_ADC_Enable(LCDisplay1.obj)
(908) exit status = 1
(908) exit status = 1


Thanks,
Dave
Attachments
LCDisplay1.fcfx
(12.3 KiB) Downloaded 29 times

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4362 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby Benj » Wed Dec 04, 2019 5:19 pm

Hi Dave,

Thanks for that, should be sorted now.

dz28
Posts: 60
Joined: Thu Aug 04, 2016 3:30 pm
Has thanked: 7 times
Been thanked: 9 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby dz28 » Wed Dec 04, 2019 7:28 pm

Ben,

Seems to be good now!
Thanks You.

Up next for this chip is the INT0,1,2 pins

The interrupts simulate fine but I am getting the following errors during compile to HEX.

LCDisplay1.c: main()
4508: INTCON2bits.INTEDG0 = 1;
^ (192) undefined identifier "INTCON2bits"
^ (196) struct/union required
4510: INTCONbits.INT0IE = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S1339
LCDisplay1.c: myisr()
4594: if ((INTCONbits.INT0IF) && (INTCONbits.INT0IE))
^ (255) not a member of the struct/union ""
(255) not a member of the struct/union "" ^
(199) logical type required ^
(199) logical type required ^
4597: INTCONbits.INT0IF = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S1339
(908) exit status = 1
(908) exit status = 1


Should we start a new topic for this one?

Thanks,
Dave

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4362 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby Benj » Thu Dec 05, 2019 10:44 am

Hi Dave,

No it's ok no need for a new topic, I'll look into this thanks for letting us know.

dz28
Posts: 60
Joined: Thu Aug 04, 2016 3:30 pm
Has thanked: 7 times
Been thanked: 9 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby dz28 » Mon Dec 30, 2019 4:52 pm

Ben,

Did you ever get a chance to look into this?

Thanks,
Dave

dz28
Posts: 60
Joined: Thu Aug 04, 2016 3:30 pm
Has thanked: 7 times
Been thanked: 9 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby dz28 » Tue Mar 10, 2020 4:21 pm

Hi Ben,

Do you think there will be any resolution to this issue or would it be best to use a different part?

Thanks,
Dave

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4362 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby Benj » Wed Mar 11, 2020 5:25 pm

Hi Dave,

This has now hopefully been fixed for you, sorry for the delay.

Let us know how you get on.

dz28
Posts: 60
Joined: Thu Aug 04, 2016 3:30 pm
Has thanked: 7 times
Been thanked: 9 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby dz28 » Tue Mar 24, 2020 11:05 pm

Thanks!
The compile to Hex how works.
These users thanked the author dz28 for the post:
Benj (Wed Mar 25, 2020 11:48 pm)
Rating: 5%
 

dz28
Posts: 60
Joined: Thu Aug 04, 2016 3:30 pm
Has thanked: 7 times
Been thanked: 9 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby dz28 » Sun Mar 29, 2020 3:46 pm

Ben,

I don't see the PIC18F45Q10 available.
Seems to be the same as PIC18F25Q10 but more I/O

Is this device not supported?
Or can this chip be developed using the PIC18F45K40 part. (seems to have the same pinout as the Q10 part.

Thanks,
Dave

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4362 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby Benj » Mon Mar 30, 2020 9:24 pm

Hi Dave,

Thanks for the request, I'll look into adding this device for you ASAP.

dz28
Posts: 60
Joined: Thu Aug 04, 2016 3:30 pm
Has thanked: 7 times
Been thanked: 9 times
Contact:

Re: PIC18F25Q10 ADC Vref

Postby dz28 » Wed Apr 01, 2020 10:31 pm

As always thanks for the support!

Dave