Hello everyone!
I use Attiny44 , Flowcode 9.2.
In the emulator, it works true and in Proteus and iron works not right!
Examples of work apply.
PWM does not work correctly
-
- Posts: 53
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 10, 2020 1:12 pm
- Has thanked: 1 time
- Been thanked: 3 times
PWM does not work correctly
- Attachments
-
- Proteus
- Proteus.jpg (161.22 KiB) Viewed 3995 times
-
- Flowcode
- FC_SET.jpg (36.98 KiB) Viewed 3995 times
-
- BG.fcfx
- Proj
- (10.53 KiB) Downloaded 170 times
-
- Matrix Staff
- Posts: 1917
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 621 times
- Been thanked: 644 times
Re: PWM does not work correctly
Hi, I don't have the Attiny44, so I won't be able to help much.
Does the hardware match the simulation or you have not tried it on hardware yet?
Can you try the one-second flasher test on your hardware to make sure the hardware is running at the correct speed?
Does the hardware match the simulation or you have not tried it on hardware yet?
Can you try the one-second flasher test on your hardware to make sure the hardware is running at the correct speed?
Martin
-
- Matrix Staff
- Posts: 1917
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 621 times
- Been thanked: 644 times
Re: PWM does not work correctly
I have just looked into this.
When you compile you will see a warning:
Therefore, to get a PWM 50% duty cycle you need to set the duty to 127.
Unfortunately, that is the disadvantage of AVR.
When you compile you will see a warning:
Code: Select all
C:\ProgramData\MatrixTSL\FlowcodeV9\CAL\AVR\AVR_CAL_PWM.c:495:3: warning: #warning "Period control register not available on target device, period will default to 255 + 1" [-Wcpp]
#warning "Period control register not available on target device, period will default to 255 + 1"
Unfortunately, that is the disadvantage of AVR.
Martin
-
- Matrix Staff
- Posts: 1917
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 621 times
- Been thanked: 644 times
Re: PWM does not work correctly
As limited PWM is caused by the limitations of AVR, I have moved topic from the bugs section.
If you believe this is resolved can please add [Resolved] to the start of your subject.
If you believe this is resolved can please add [Resolved] to the start of your subject.
Martin