Analogue I/P on 16 Bit PIC

Use this section to discuss your embedded Flowcode projects.
Post Reply
simon-sandtcontrols
Posts: 43
http://meble-kuchenne.info.pl
Joined: Sun Mar 21, 2021 3:56 pm
Has thanked: 5 times
Been thanked: 7 times

Flowcode v10 Analogue I/P on 16 Bit PIC

Post by simon-sandtcontrols »

Hi All,

I wonder if anyone can help. The last 2 things I thought were bugs, weren't and it was properties I had missed (used to be set in V9 and not in V10 etc) etc. So I am guess I am doing something daft or missing something again.
I am using a PIC 24FJ128GB202. I had a program working and then I added and "potentiometer" component, after that it wouldn't compile. It returns:

C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c: In function 'FC_CAL_ADC_Enable_1':
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c:84:27: error: 'AD1PCFG' undeclared (first use in this function)
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c:84:27: note: each undeclared identifier is reported only once for each function it appears in
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c:95:15: error: 'AD1CON2BITS' has no member named 'VCFG0'
C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c:97:15: error: 'AD1CON2BITS' has no member named 'VCFG0'
Myriad Mic Live V1_2.c: In function 'main':
Myriad Mic Live V1_2.c:4138:2: warning: 'return' with a value, in function returning void

Error returned from [xc16-gcc.exe]

I have gone through all of the properties, and tried changing them, the default Vref voltage was 500 and this chip is a 3v3 so I tried 330 and 300, I have tried several different inputs and the "Conversion" defaults to blank so I have tried a couple of options from here.
I tried doing exactly the same thing, adding a potentiometer in a program with a PIC16F1937 and it worked fine. Leading me to think there is a difference between the 8 Bit and 16 Bit PIC I am missing when using an analogue input.

If I delete the potentiometer it complies fine and I have tried both types of potentiometer, slider and rotary and I get the same error.

I have tried opening a new program with no flow chart in it. I added a push button and it compiled fine, added a potentiometer and it failed to compile. so I don't think it's anything to do with my existing code.

Anyone think of what I am missing please?


Many Thanks.

Simon.
Attachments
Screenshot 2024-09-01 191414.png
Screenshot 2024-09-01 191414.png (115.91 KiB) Viewed 6978 times

BenR
Matrix Staff
Posts: 1940
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 506 times
Been thanked: 689 times

Re: Analogue I/P on 16 Bit PIC

Post by BenR »

Hi Simon,

Hmm looks like the compiler has a typo for that device. I'll see if I can add in a workaround for you.

BenR
Matrix Staff
Posts: 1940
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 506 times
Been thanked: 689 times

Re: Analogue I/P on 16 Bit PIC

Post by BenR »

Hello,

Sorry no it was a problem with our definitions in the end. I've fixed the issue and uploaded the fix to the library updates.

Let us know how you get on.

simon-sandtcontrols
Posts: 43
Joined: Sun Mar 21, 2021 3:56 pm
Has thanked: 5 times
Been thanked: 7 times

Re: Analogue I/P on 16 Bit PIC

Post by simon-sandtcontrols »

Magic, Thanks Ben,

Yep, just tried adding it in and it compiles.

Much Appreciated.

Simon

Post Reply