Compiling error with ADC

Moderator: Benj

Post Reply
r_romeo
Posts: 54
Joined: Wed Nov 02, 2011 3:57 pm
Has thanked: 14 times
Been thanked: 3 times
Contact:

Compiling error with ADC

Post by r_romeo »

Hi, I am having a problem compiling a simple ADC to servomotor code in V5 dsPIC latest release (V5.5.2.1), I re-made the code in V4 and compiles (is very short).


I checked

http://www.matrixmultimedia.com/mmforum ... 077#p31579

and

http://www.matrixmultimedia.com/mmforum ... 445#p31445

and does not seems that is the problem

the message file says:
servomotor test.c: In function 'FCD_ADC0_ReadAsString':
servomotor test.c:644: warning: pointer targets in passing argument 3 of 'FCI_FLOAT_TO_STRING' differ in signedness
In file included from C:\Program Files (x86)\Flowcode(dsPIC)\v5\CAL\includes.c:44,
from servomotor test.c:715:
C:\Program Files (x86)\Flowcode(dsPIC)\v5\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c: In function 'FC_CAL_Disable_ADC':
C:\Program Files (x86)\Flowcode(dsPIC)\v5\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c:245: error: 'AD1CON1bits' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode(dsPIC)\v5\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c:245: error: (Each undeclared identifier is reported only once
C:\Program Files (x86)\Flowcode(dsPIC)\v5\CAL\/PIC16BIT\PIC16BIT_CAL_ADC.c:245: error: for each function it appears in.)

Error returned from [pic30-gcc.exe]
Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:


If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.


FINISHED
When I upgraded to V5.5.2.1 I didn't do the fixings of the older version, Should I do it?
( http://www.matrixmultimedia.com/mmforum ... 46&t=10669 )
not sure what is the problem, can anyone help?

here is the file
servomotor test.fcf_pic16
(8.5 KiB) Downloaded 454 times

thanks!

r_romeo
Posts: 54
Joined: Wed Nov 02, 2011 3:57 pm
Has thanked: 14 times
Been thanked: 3 times
Contact:

Re: Compiling error with ADC

Post by r_romeo »

Hello ,
Any feedback ?

r_romeo
Posts: 54
Joined: Wed Nov 02, 2011 3:57 pm
Has thanked: 14 times
Been thanked: 3 times
Contact:

Re: Compiling error with ADC, help from matrix needed

Post by r_romeo »

I think I know the problem: is very similar to http://www.matrixmultimedia.com/mmforum ... red#p26296

I guess the solution also may be similar, I was looking in the code but my problem is I've got lost, there is a definition in flowcode that is missing
(error: 'AD1CON1bits' undeclared ) It may be because a change in the name, so Supplementary code should solve the issue

I need feedback from MATRIX,

Thanks

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: Compiling error with ADC

Post by Benj »

Hello,

I will look into this for you and see if it is a simple fix.

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: Compiling error with ADC

Post by Benj »

Hello,

Ok I think I have found the issue, please can you try this updated CAL file and it should resolve the issue for you.
PIC16BIT_CAL_ADC.c
(32.53 KiB) Downloaded 383 times

r_romeo
Posts: 54
Joined: Wed Nov 02, 2011 3:57 pm
Has thanked: 14 times
Been thanked: 3 times
Contact:

Re: Compiling error with ADC

Post by r_romeo »

Now is compiling, thanks !!!

Post Reply