Bug in ARM PWM Component Macro

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
ARM
Posts: 29
Joined: Sun Oct 04, 2015 11:52 am
Been thanked: 3 times
Contact:

Bug in ARM PWM Component Macro

Post by ARM »

Hello,

After I had plug in a PWM component in my system I got the following compiler error:
(The error occurs also when I open an empty project and add a PWM component to the System window, without any PWM program code.)

___________ Compiler Message ______________

Device: ARM.AT91SAM7S.AT91SAM7S512_64

Start des Compilers...
C:\Program Files\Flowcode 6\compilers\arm\batchfiles\arm7comp.bat "Mill Control - Test_3" "D:\release\ELECTR~1\DIGITA~1\Flowcode\AT91SA~1\MILLCO~1\"
Launching compiler...
In file included from C:\Program Files\Flowcode 6\CAL\includes.c:232,
from Mill Control - Test_3.c:345:
C:\Program Files\Flowcode 6\CAL\/ARM\ARM_CAL_PWM.c:61:5: error: #error "This chip does not have PWM channel 1 defined"
In file included from C:\Program Files\Flowcode 6\CAL\includes.c:232,
from Mill Control - Test_3.c:345:
C:\Program Files\Flowcode 6\CAL\/ARM\ARM_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_1':
C:\Program Files\Flowcode 6\CAL\/ARM\ARM_CAL_PWM.c:63: warning: implicit declaration of function 'MX_PWM_1_PORT_out'
C:\Program Files\Flowcode 6\CAL\/ARM\ARM_CAL_PWM.c:63: error: 'MX_PWM_1_PIN' undeclared (first use in this function)
C:\Program Files\Flowcode 6\CAL\/ARM\ARM_CAL_PWM.c:63: error: (Each undeclared identifier is reported only once
C:\Program Files\Flowcode 6\CAL\/ARM\ARM_CAL_PWM.c:63: error: for each function it appears in.)
Mill Control - Test_3.c: In function 'FCD_0ba71_PWM_Digital__PrintNumber':
Mill Control - Test_3.c:424: warning: pointer targets in passing argument 2 of 'FCI_TOSTRING' differ in signedness
Mill Control - Test_3.c: In function 'FCD_0ba71_PWM_Digital__Print':
Mill Control - Test_3.c:703: warning: pointer targets in passing argument 1 of 'FCI_GETLENGTH' differ in signedness
Mill Control - Test_3.c: In function 'FCD_047b1_RS232__SendString':
Mill Control - Test_3.c:1664: warning: pointer targets in passing argument 1 of 'FCI_GETLENGTH' differ in signedness

Error returned from [arm-elf-gcc.exe]

Completed compilation, return = 1

C:\Program Files\Flowcode 6\compilers\arm\batchfiles\arm7comp.bat Hat den Fehlercode 1 gemeldet


BEENDET

Mill Control - Test_3.fcfx
(42.35 KiB) Downloaded 216 times

greetings

ARM

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: Bug in ARM PWM Component Macro

Post by Benj »

Hello Arm,

Thanks for letting us know.

Please find attached an updated CAL file below. The file needs to be placed into your "Flowcode 6/CAL/ARM" directory and then hopefully the compilation will be ok when using PWM components.
ARM_CAL_PWM.c
(10.15 KiB) Downloaded 281 times
Let me know how you get on and I will check in the change.

ARM
Posts: 29
Joined: Sun Oct 04, 2015 11:52 am
Been thanked: 3 times
Contact:

Re: Bug in ARM PWM Component Macro

Post by ARM »

Hello,

I have replace the CAL file in the ARM directory and now the compiler generats the folowing message:

Device: ARM.AT91SAM7S.AT91SAM7S512_64
Generated by: Flowcode v6.1.2.0

Start des Compilers...
C:\Program Files\Flowcode 6\compilers\arm\batchfiles\arm7comp.bat "Mill Control - Test_4" "D:\release\ELECTR~1\DIGITA~1\Flowcode\AT91SA~1\MILLCO~1\"
Launching compiler...
In file included from C:\Program Files\Flowcode 6\CAL\includes.c:232,
from Mill Control - Test_4.c:365:
C:\Program Files\Flowcode 6\CAL\/ARM\ARM_CAL_PWM.c:49: error: conflicting types for 'FC_CAL_PWM_ChangePeriod_1'
Mill Control - Test_4.c:236: error: previous declaration of 'FC_CAL_PWM_ChangePeriod_1' was here
C:\Program Files\Flowcode 6\CAL\/ARM\ARM_CAL_PWM.c:201: error: conflicting types for 'FC_CAL_PWM_ChangePeriod_1'
Mill Control - Test_4.c:236: error: previous declaration of 'FC_CAL_PWM_ChangePeriod_1' was here
Mill Control - Test_4.c: In function 'FCD_0ba71_PWM_Digital__PrintNumber':
Mill Control - Test_4.c:444: warning: pointer targets in passing argument 2 of 'FCI_TOSTRING' differ in signedness
Mill Control - Test_4.c: In function 'FCD_0ba71_PWM_Digital__Print':
Mill Control - Test_4.c:723: warning: pointer targets in passing argument 1 of 'FCI_GETLENGTH' differ in signedness
Mill Control - Test_4.c: In function 'FCD_047b1_RS232__SendString':
Mill Control - Test_4.c:1790: warning: pointer targets in passing argument 1 of 'FCI_GETLENGTH' differ in signedness

Error returned from [arm-elf-gcc.exe]
Completed compilation, return = 1

C:\Program Files\Flowcode 6\compilers\arm\batchfiles\arm7comp.bat Hat den Fehlercode 1 gemeldet

BEENDET

Mill Control - Test_4.fcfx
(44.38 KiB) Downloaded 229 times

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: Bug in ARM PWM Component Macro

Post by Benj »

Aha,

Sorry about that. Have you got the latest PWM component files from here.

http://www.matrixtsl.com/mmforums/viewt ... 54&t=17032

ARM
Posts: 29
Joined: Sun Oct 04, 2015 11:52 am
Been thanked: 3 times
Contact:

Re: Bug in ARM PWM Component Macro

Post by ARM »

Hello,

I had copy the update files and now I have no compiler error. There are still warnings (see attachment), but
the program runs. Many thanks.
Mill Control - Test_4.msg.txt
(2.55 KiB) Downloaded 246 times

I have still two questions to PWM component:

1.) In the properties of the PWM component the maximum value of "Period Overflow" is 255.
The maximun value of "Prescaler" is 1024. So the lowest frequency where I can generate is 0,1828212 KHz (PLL Frequency 47923200Hz and 18,432MHz XTAL).
It is not possible to set the "Period Overflow" to value 65535.

I need this to drive the stepper motor very slow (about 2 Step per seconds) manually via encoder hand wheel.
Is there a way to generate a frequency over PWM channel with 1Hz.


2.) When I open component macro "PWM" "Change Period" I cannot change values. The PWM frequency in the running program is
always the same as the value in the PWM properties. I had "Disable" PWM then "Change Period" and then "Enable" PWM,
but it also doesn´t work.


greetings

ARM

ARM
Posts: 29
Joined: Sun Oct 04, 2015 11:52 am
Been thanked: 3 times
Contact:

Re: Bug in ARM PWM Component Macro

Post by ARM »

Hello,

here I have the latest update:

In PWM component:
()=10bit command
Cannot set duty cycle. 0-1 (0-19)=PWM is off. 2-255 (20-1024)=PWM is running but no frequency change. Testted with "setDutyCycle" and "SetDutyCycle10".
And command "changePeriod" has no effect. Only value in the PWM component Properties is active.

(Tested with a simple stepper motor driver)

Post Reply