dsPIC33 compiler errors.........

Thread Starter

yan_c

Joined Jun 17, 2011
8
Hi, Trying to build come simple code to o/p a 50Hz sine wave from a LUT but cant get rid of the last few compiler errors and wondered if anyone could help at all....

Target device is a dsPEC33FJ256MC710

MOD FESS Main.c:97: warning: type defaults to 'int' in declaration of 'PTCON'
MOD FESS Main.c:97: error: conflicting type qualifiers for 'PTCON'
c:/program files/microchip/mplab c30/bin/bin/../../support/dsPIC33F/h/p33FJ256MC710.h:1713: error: previous declaration of 'PTCON' was here
MOD FESS Main.c:97: warning: data definition has no type or storage class
MOD FESS Main.c:103: warning: type defaults to 'int' in declaration of 'PTPER'
MOD FESS Main.c:103: error: conflicting type qualifiers for 'PTPER'
c:/program files/microchip/mplab c30/bin/bin/../../support/dsPIC33F/h/p33FJ256MC710.h:1759: error: previous declaration of 'PTPER' was here
MOD FESS Main.c:103: warning: data definition has no type or storage class
MOD FESS Main.c:111: error: syntax error before '.' token
MOD FESS Main.c:130: warning: type defaults to 'int' in declaration of 'PTMR'
MOD FESS Main.c:130: error: conflicting type qualifiers for 'PTMR'
c:/program files/microchip/mplab c30/bin/bin/../../support/dsPIC33F/h/p33FJ256MC710.h:1746: error: previous declaration of 'PTMR' was here
MOD FESS Main.c:130: warning: data definition has no type or storage class
MOD FESS Main.c:132: error: syntax error before '.' token
MOD FESS Main.c:134: warning: type defaults to 'int' in declaration of 'PDTCON1'
MOD FESS Main.c:134: warning: data definition has no type or storage class
MOD FESS Main.c:135: warning: type defaults to 'int' in declaration of 'PDTCON2'
MOD FESS Main.c:135: warning: data definition has no type or storage class
MOD FESS Main.c:136: warning: type defaults to 'int' in declaration of 'POVDCON'
MOD FESS Main.c:136: warning: data definition has no type or storage class
MOD FESS Main.c:138: warning: type defaults to 'int' in declaration of 'PFLTACON'
MOD FESS Main.c:138: warning: data definition has no type or storage class
MOD FESS Main.c:139: warning: type defaults to 'int' in declaration of 'PFLTBCON'
MOD FESS Main.c:139: warning: data definition has no type or storage class
MOD FESS Main.c:149: error: syntax error before 'while'
MOD FESS Main.c:156: warning: type defaults to 'int' in declaration of 'PDC1'
MOD FESS Main.c:156: error: conflicting type qualifiers for 'PDC1'
c:/program files/microchip/mplab c30/bin/bin/../../support/dsPIC33F/h/p33FJ256MC710.h:2062: error: previous declaration of 'PDC1' was here
MOD FESS Main.c:156: warning: data definition has no type or storage class
MOD FESS Main.c:156: error: syntax error before '=' token
MOD FESS Main.c:167:2: error: #endif without #if

Any help would be most appreciated....
Thanks​
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
I don't use that compiler so I don't know the sizes of your types, but obviously neither do you. <grin>

Open up the fine manual and see how big an int is, that is most of your problems there.

See line 97: you define 16 bits for an int. It causes an error.

See line 98: you just assign the very same thing to "0" and all is well. That is because the compiler knows how big an int is and makes an int sized version of "0" to fill that register.

Line 156 is interesting. I suspect you were trying to pull a constant out of the SineTable[] array, yet you call the Sine function.

Also, whenever the compiler barks error: conflicting type qualifiers for {something}" and "previous declaration of '{something}' was here" it is telling you something was defined twice. I don't see where you are defining PDC1, but DO remove the ; from 76, 77, 78 as #define is a straight test substitution, meaning you are putting ";" into your code below.

#define does not need the terminating ;
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
Huh, I think the OP actually tried some of the things they said.

Geeze, I missed that most of his errors are in the free floating code before main().

van: I think you need to slow down, drop back and get something really simple to compile and then simulate. However, if you insist....

move the code from lines 91 to 139 into main (below that line). Also, IMMEDIATE following main() put a {

And get rid of that last #endif
 

Thread Starter

yan_c

Joined Jun 17, 2011
8
Hi ErnieM, many thanks for your help. Managed to get it to compile with just one warning, so a big step forward........!!

Just need to get it to do what I want now, so I might be back needing a bit more advice.

Thanks again to all.......
 

ErnieM

Joined Apr 24, 2011
8,377
Glad you are making progress.

I don't accept any compile as good until I can fix all the warnings. Warnings usually mean you did something you should not have, and while the compiler could take a guess at your intentions it IS guessing and generally it guesses wrong.
 
Top