Page 1 of 1

AVR compiler errors

Posted: Tue Aug 14, 2012 3:07 am
by stasiks
Hello
There was a need for the Programming all was good while the PWM launched, during compilation appear in the following problem:

Code: Select all

/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_Channel_1':
/AVR\AVR_CAL_PWM.c:671: error: 'COM0A0' undeclared (first use in this function)
/AVR\AVR_CAL_PWM.c:671: error: (Each undeclared identifier is reported only once
/AVR\AVR_CAL_PWM.c:671: error: for each function it appears in.)
/AVR\AVR_CAL_PWM.c:676: error: 'COM0A1' undeclared (first use in this function)
/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Disable_Channel_1':
/AVR\AVR_CAL_PWM.c:702: error: 'COM0A1' undeclared (first use in this function)
/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Set_Duty_8Bit_1':
/AVR\AVR_CAL_PWM.c:845: error: 'OCR0A' undeclared (first use in this function)
/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Set_Duty_10Bit_1':
/AVR\AVR_CAL_PWM.c:1121: error: 'OCR0A' undeclared (first use in this function)
Search forum but did not find anything in google could not do anything useful to tell.
From the C language do not understand anything so I'm desperate please help, Thanks

Re: AVR compiler errors

Posted: Tue Aug 14, 2012 8:47 am
by DavidA
Hello,

Could you post a Flowchart and the generated c code which exhibits this problem

Re: AVR compiler errors

Posted: Tue Aug 14, 2012 3:16 pm
by stasiks
Thank you that answered so quickly, here is Flowcharts and the generated c code.
Thank you.

Re: AVR compiler errors

Posted: Tue Aug 14, 2012 3:57 pm
by Benj
Hello,

I will try and get this sorted in the main PWM CAL file. For now you can fix the issue by using this workaround.

Click On Build -> Project Options.

Tick the box "Use supplementary code" and then click the button "Supplementary code"

In the top window paste the following section of code.

Code: Select all

#define COM0A0 COM00
#define COM0A1 COM01
#define OCR0A OCR0
Click OK twice and the program should now compile correctly.

Let me know if you have any problems.

Re: AVR compiler errors

Posted: Tue Aug 14, 2012 4:31 pm
by stasiks
Thank you very much, everything did and everything was successful.
Thank you very much :D

Re: AVR compiler errors

Posted: Sun Sep 07, 2014 6:06 am
by vlad1451
Hello. Prompt, and it is possible to involve all PWM channels in the controler. If I am not mistaken at Mega16/32 their 4 channels.

Re: AVR compiler errors

Posted: Thu Sep 11, 2014 1:10 pm
by vlad1451
Really there is no opportunity to involve all 4 channels?!!!

Re: AVR compiler errors

Posted: Fri Sep 12, 2014 2:06 pm
by Benj
Hello,

I have now fixed this in v6 for the ATMEGA32 which only showed 3 of the 4 available channels. Do you need this fix in v5 or v6?

Re: AVR compiler errors

Posted: Mon Sep 15, 2014 12:43 pm
by vlad1451
v5

Re: AVR compiler errors

Posted: Mon Sep 15, 2014 12:46 pm
by Benj
Hello,

Ok this updated definition file should resolve the problem.
ATMEGA32.fcd
(10.11 KiB) Downloaded 438 times
Let me know how you get on.

Re: AVR compiler errors

Posted: Mon Sep 15, 2014 1:08 pm
by vlad1451
Thanks.

Re: AVR compiler errors

Posted: Mon Sep 15, 2014 7:06 pm
by vlad1451
In case of compilation gives out the same error:

Code: Select all

C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_Channel_2':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: 'MX_TCCR_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: (Each undeclared identifier is reported only once
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: for each function it appears in.)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: 'MX_PWM_COM0_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:676: error: 'MX_PWM_COM1_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Disable_Channel_2':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:702: error: 'MX_TCCR_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:702: error: 'MX_PWM_COM1_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Set_Duty_8Bit_2':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:845: error: 'MX_DUTY_REG_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Change_Period_2':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:977: error: 'MX_PRESCALE_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Set_Duty_10Bit_2':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:1121: error: 'MX_DUTY_REG_X' undeclared (first use in this function)
Test project on 4 canals:

Re: AVR compiler errors

Posted: Tue Sep 16, 2014 1:58 pm
by Benj
Hello,

If you go into the project options, enable supplementary code and then paste the following code into the top window of the supplementary code then the program should compile as expected.

Code: Select all

#define COM0A0 COM00
#define COM0A1 COM01
#define OCR0A OCR0
Let me know how you get on.

Re: AVR compiler errors

Posted: Tue Sep 16, 2014 2:40 pm
by vlad1451
Hello, I inserted this code and still gives out an error:

Code: Select all

C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_Channel_4':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: 'MX_TCCR_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: (Each undeclared identifier is reported only once
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: for each function it appears in.)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: 'MX_PWM_COM0_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:676: error: 'MX_PWM_COM1_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Disable_Channel_4':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:702: error: 'MX_TCCR_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:702: error: 'MX_PWM_COM1_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Set_Duty_8Bit_4':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:845: error: 'MX_DUTY_REG_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Change_Period_4':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:977: error: 'MX_PRESCALE_X' undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Set_Duty_10Bit_4':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:1121: error: 'MX_DUTY_REG_X' undeclared (first use in this function)

Re: AVR compiler errors

Posted: Tue Sep 16, 2014 2:51 pm
by Benj
Hello,

Many thanks. I have managed to track down the issue and the attached definition file should solve all the problems, no need for the supplementary code workaround any more.
ATMEGA32.fcd
(10.19 KiB) Downloaded 362 times
Let me know how you get on.

Re: AVR compiler errors

Posted: Tue Sep 16, 2014 3:12 pm
by vlad1451
Everything works, many thanks. It is pleasant to deal with you. I apologize for my English, I from Russia.