ATMEGA128/64 PWM build Error

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

ATMEGA128/64 PWM build Error

Post by karthickefy »

Hi Matrix Team,
When I'm using PWM function, I face build error while compiling hex with ATMEGA128 MCU . Attached is the error report. I'm facing this compiling error only if I used PWM function with ATMEGA128 MCU. Do I need to declare any function? Can you please guide me to resolve this issues?
Attachments
ATMEGA128 PWM build error.txt
(2.76 KiB) Downloaded 143 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: ATMEGA128/64 PWM build Error

Post by Benj »

Hello,

Thanks for letting us know. I've hopefully now fixed the problem and pushed the change to the v8 update system.

Let us know how you get on.

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: ATMEGA128/64 PWM build Error

Post by karthickefy »

HI Benj,
Thank you very much. Now PWM is working with ATMEGA128 . But I cannot control the frequency and Duty cycle. I'm not sure whether I may made some mistakes in my program. Please find the attached code and Logic analyzer's PWM data. Please guide me. Thanks
Attachments
PWM.png
(159.07 KiB) Downloaded 789 times
pwm1.fcfx
(9.73 KiB) Downloaded 167 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: ATMEGA128/64 PWM build Error

Post by Benj »

Hello,

If you look at the compiler messages then you should see this line.
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:495:3: warning: #warning "Period control register not available on target device, period will default to 255 + 1"
In your loop you are calling ChangePeriod but as the warning message states the device does not have the period register and so it cannot be altered. Maybe try a different PWM channel as the other channels seem more standard.

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: ATMEGA128/64 PWM build Error

Post by karthickefy »

Dear Benj,
Thanks. It is working fine now. i didn't see the warning message.

Karthick

Post Reply