V5 for AVR: PWM does not work
Posted: Thu Aug 23, 2012 7:29 pm
Hi,
As I have (yet) no access to the V5 forum, I place this contribution here and hope somebody will move it to V5 and give me access. Thank you.
I have already mailed my issue some time ago. I just experience the PWM-function. Simulation shows correct function but download to chip leads to following
failure message:
File name: E:\STEUERWALD-AVR-CONTROLLER\FLOWCODE-Programmierung\Testprogramme\FanPWM.c
Title:
Description:
Generated by: Flowcode v5.3.0.0
Date: Thursday, July 19, 2012 23:08:47
Licence: Professional
Registered to: Gerhard Steuerwald
Licence key: Q9XMDC
http://www.matrixmultimedia.com
Start des Compilers...
C:\Program Files\Flowcode(AVR)\v5\Tools\MX_bats\avra.bat atmega32 "E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.elf" "E:\ST9851~1\FLOWCO~1\TESTPR~1\Fan PWM.c" "E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.lst"
E:\STEUERWALD-AVR-CONTROLLER\FLOWCODE-Programmierung\Testprogramme>"C:\PROGRA~1\FLOWCO~1\v5\Tools\MX_bats\..\bin\avr-gcc.exe"-mmcu=atmega32 -Os -funsigned-char -o "E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.elf" "E:\ST9851~1\FLOWCO~1\TESTPR~1\Fan PWM.c" -lm
In file included from C:\Program Files\Flowcode(AVR)\v5\CAL\includes.c:227,
from E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.c:481:
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:101:5: warning:#warning "PWM Channel Uses Resource Timer 0"
In file included from C:\Program Files\Flowcode(AVR)\v5\CAL\includes.c:227,
from E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.c:481:
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_Channel_1':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: 'COM0A0'undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: (Eachundeclared identifier is reported only once
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: foreach function it appears in.)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:676: error: 'COM0A1'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_1':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:702: error: 'COM0A1'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_1':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:845: error: 'OCR0A'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_1':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c error: 'OCR0A'undeclared (first use in this function)
Error returned from [avr-gcc.exe]
Rückgabewert = 1
Flowcode konnte den C-Code des Flussdiagramms nicht kompilieren, da folgendeFehler auftraten:
Wenn Ihr Flussdiagramm C-Code enthält,überprüfen Sie diesen sorgfältig.Falls das Flussdiagramm keinen C-Code enthält oder Sie sich sicher seinkönnen, dass dieser Code fehlerfrei ist, dann wenden Sie sich an den technischenSupport.
BEENDET
Now I got already help by mail from Steve Tandy who proposed a workaround with the following code into the top box of the "supplementary code"feature (via the "project options" window):
#define COM0A0 COM00
#define COM0A1 COM01
#define OCR0A OCR0
This was successful regarding download to chip. Download to chip is now possible without errors but I cannot achieve the(hardware) PWM-output signal on PD5 (with PWM(0)). I also tried PD4 withPWM(1), no success.
Do you have a further idea to make the PWM function work on the controller?
Best regards and thanks in advance.
Gerhard
As I have (yet) no access to the V5 forum, I place this contribution here and hope somebody will move it to V5 and give me access. Thank you.
I have already mailed my issue some time ago. I just experience the PWM-function. Simulation shows correct function but download to chip leads to following
failure message:
File name: E:\STEUERWALD-AVR-CONTROLLER\FLOWCODE-Programmierung\Testprogramme\FanPWM.c
Title:
Description:
Generated by: Flowcode v5.3.0.0
Date: Thursday, July 19, 2012 23:08:47
Licence: Professional
Registered to: Gerhard Steuerwald
Licence key: Q9XMDC
http://www.matrixmultimedia.com
Start des Compilers...
C:\Program Files\Flowcode(AVR)\v5\Tools\MX_bats\avra.bat atmega32 "E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.elf" "E:\ST9851~1\FLOWCO~1\TESTPR~1\Fan PWM.c" "E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.lst"
E:\STEUERWALD-AVR-CONTROLLER\FLOWCODE-Programmierung\Testprogramme>"C:\PROGRA~1\FLOWCO~1\v5\Tools\MX_bats\..\bin\avr-gcc.exe"-mmcu=atmega32 -Os -funsigned-char -o "E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.elf" "E:\ST9851~1\FLOWCO~1\TESTPR~1\Fan PWM.c" -lm
In file included from C:\Program Files\Flowcode(AVR)\v5\CAL\includes.c:227,
from E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.c:481:
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:101:5: warning:#warning "PWM Channel Uses Resource Timer 0"
In file included from C:\Program Files\Flowcode(AVR)\v5\CAL\includes.c:227,
from E:\ST9851~1\FLOWCO~1\TESTPR~1\FanPWM.c:481:
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_Channel_1':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: 'COM0A0'undeclared (first use in this function)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: (Eachundeclared identifier is reported only once
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:671: error: foreach function it appears in.)
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:676: error: 'COM0A1'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_1':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:702: error: 'COM0A1'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_1':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c:845: error: 'OCR0A'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_1':
C:\Program Files\Flowcode(AVR)\v5\CAL\/AVR\AVR_CAL_PWM.c error: 'OCR0A'undeclared (first use in this function)
Error returned from [avr-gcc.exe]
Rückgabewert = 1
Flowcode konnte den C-Code des Flussdiagramms nicht kompilieren, da folgendeFehler auftraten:
Wenn Ihr Flussdiagramm C-Code enthält,überprüfen Sie diesen sorgfältig.Falls das Flussdiagramm keinen C-Code enthält oder Sie sich sicher seinkönnen, dass dieser Code fehlerfrei ist, dann wenden Sie sich an den technischenSupport.
BEENDET
Now I got already help by mail from Steve Tandy who proposed a workaround with the following code into the top box of the "supplementary code"feature (via the "project options" window):
#define COM0A0 COM00
#define COM0A1 COM01
#define OCR0A OCR0
This was successful regarding download to chip. Download to chip is now possible without errors but I cannot achieve the(hardware) PWM-output signal on PD5 (with PWM(0)). I also tried PD4 withPWM(1), no success.
Do you have a further idea to make the PWM function work on the controller?
Best regards and thanks in advance.
Gerhard