Compiling error with ADC

Moderator: Benj

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

Postby r_romeo » Tue Mar 12, 2013 9:44 pm

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/mmforums/viewtopic.php?f=29&t=10077#p31579

and

http://www.matrixmultimedia.com/mmforums/viewtopic.php?f=29&p=31445#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/mmforums/viewtopic.php?f=46&t=10669 )
not sure what is the problem, can anyone help?

here is the file

servomotor test.fcf_pic16
(8.5 KiB) Downloaded 242 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

Postby r_romeo » Sat Mar 23, 2013 6:16 pm

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

Postby r_romeo » Thu Apr 25, 2013 10:03 am

I think I know the problem: is very similar to http://www.matrixmultimedia.com/mmforums/viewtopic.php?f=29&t=8713&p=26296&hilit=undeclared#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: 14567
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4598 times
Been thanked: 4239 times
Contact:

Re: Compiling error with ADC

Postby Benj » Thu Apr 25, 2013 10:23 am

Hello,

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

User avatar
Benj
Matrix Staff
Posts: 14567
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4598 times
Been thanked: 4239 times
Contact:

Re: Compiling error with ADC

Postby Benj » Thu Apr 25, 2013 11:38 am

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
(33.91 KiB) Downloaded 188 times
These users thanked the author Benj for the post:
r_romeo (Thu Apr 25, 2013 12:10 pm)
Rating: 5.26%
 

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

Postby r_romeo » Thu Apr 25, 2013 12:10 pm

Now is compiling, thanks !!!
These users thanked the author r_romeo for the post:
Benj (Thu Apr 25, 2013 3:47 pm)
Rating: 5.26%