PIC18F25Q10 ADC Vref

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

Moderator: Benj

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

PIC18F25Q10 ADC Vref

Post by dz28 »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC18F25Q10 ADC Vref

Post by Benj »

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

Post by dz28 »

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 183 times

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: PIC18F25Q10 ADC Vref

Post by Benj »

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

Post by dz28 »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC18F25Q10 ADC Vref

Post by Benj »

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

Post by dz28 »

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

Post by dz28 »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC18F25Q10 ADC Vref

Post by Benj »

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

Post by dz28 »

Thanks!
The compile to Hex how works.

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

Re: PIC18F25Q10 ADC Vref

Post by dz28 »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC18F25Q10 ADC Vref

Post by Benj »

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

Post by dz28 »

As always thanks for the support!

Dave

Post Reply