Page 1 of 1

PIC 10LF322 with ADC, complier problem

Posted: Mon Jun 25, 2018 5:39 pm
by cavalli
Hello
We have buy Flowcode7 for use with PIC 10LF322.
When we use a ADC like the potentiometer then
we receve evrytime this message from the complier:

C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c:
FC_CAL_ADC_Enable() 3030: ADCON0 = 0x00;
^ (192) undefined identifier "ADCON0"
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c:
FC_CAL_ADC_Sample()3061: while (ADCON0 & 0x02);
^ (192) undefined identifier "ADCON0"
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c:
FC_CAL_ADC_Disable()3074: ADCON0 = 0x00;
^ (192) undefined identifier "ADCON0"
(908) exit status = 1
(908) exit status = 1

With PIC 12.... all is ok, but with PIC 10LF322 not.
In the Simulation all works good.

Thank you very much for your help!
Best regards
M. Cavalli / Proklam

Re: PIC 10LF322 with ADC, complier problem

Posted: Mon Jun 25, 2018 6:53 pm
by medelec35
Hi cavalli,
Welcome to Matrixtsl forums.
There is a bug in the PIC_CAL_ADC.c file
Attached is an unofficial fix as I don't work for matrixtsl.
Just place the attached file in..
64 Bit windows: C:\Program Files (x86)\Flowcode 7\CAL\PIC\
32 Bit windows: C:\Program Files\Flowcode 7\CAL\PIC\
You will need to reload flowchart before the fix can take effect.

Martin

Re: PIC 10LF322 with ADC, complier problem

Posted: Tue Jun 26, 2018 12:50 pm
by Benj
Thanks Martin,

I've been investigating this and the 10F ADC problem is actually quite involved so I've now posted a new v7 update patch here to tackle this and a few other issues we have collected along the way. I'll do a similar push to the v8 updates system later on today.

viewtopic.php?f=63&t=19743

The fixes include:

Adding ADC channel 2 to PIC10F32x devices
Adding data direction register support for PIC10F32x devices
Inlining the code to allow PIC10F22x devices to compile avoiding limited stack problems
Adding missing ADC conversion rates for PIC10F32x devices

Re: PIC 10LF322 with ADC, complier problem

Posted: Tue Jun 26, 2018 12:55 pm
by cavalli
Hi Martin

Thank you for the answer.

We have download your PIC_CAL_ADC.c and instal in
64 Bit windows: C:\Program Files (x86)\Flowcode 7\CAL\PIC\

Now we reseve at the complier:
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c: 3037: (849) illegal instruction for this processor

We have look on the PIC_CAL_ADC.c Is there a
ADC Type .. Supported Devices for the " PIC10LF322" ?

Thank you very much for the help.
Best regards
M. Cavalli

Re: PIC 10LF322 with ADC, complier problem

Posted: Tue Jun 26, 2018 1:31 pm
by medelec35
Hi Cavalli,
cavalli wrote:Now we reseve at the complier:
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c: 3037: (849) illegal instruction for this processor

We have look on the PIC_CAL_ADC.c Is there a
ADC Type .. Supported Devices for the " PIC10LF322" ?
Ben has looked in to 10F devices and posted an update that covers other ADC issues as well .
Just click on the link for updates in his post above.
When you follow the link, You will see the zip file is in the first post, and the latest update details including 10F series is on the last post.

Martin

Re: PIC 10LF322 with ADC, complier problem

Posted: Tue Jun 26, 2018 1:40 pm
by cavalli
Hi Martin

Thank you very much.

After do the update now works!

Best regards
Cavalli