Analogue I/P on 16 Bit PIC
Posted: Sun Sep 01, 2024 7:16 pm
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.
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.