Page 1 of 1

PWM ouput directly from MIAC Arduino

Posted: Thu Nov 17, 2016 5:43 pm
by Monie Jacobsen
Hello everyone
Can I make PWM ouput directly from MIAC Arduino
Type: MI5466 AVR ATmega1281
How can PWM ouput made?
Like a small code eksemple!

The example below does not work in MIAC Arduino.
Attached:
MIAC PWM TEST.fcfx
(7.55 KiB) Downloaded 437 times

Re: PWM ouput directly from MIAC Arduino

Posted: Fri Nov 18, 2016 9:52 am
by LeighM
Hi Monie

Motor 1 (PB7) is an enable signal for outputs A and B
So you also need to set A and/or B.
So just add for example OutputON(1)

Hope that helps,
Leigh

Re: PWM ouput directly from MIAC Arduino

Posted: Fri Nov 18, 2016 10:29 am
by Monie Jacobsen
HI LeighM
On the oscilloscope I can not see anything PWM ouput A or B
I use your example!
User Flowcode v7

Re: PWM ouput directly from MIAC Arduino

Posted: Fri Nov 18, 2016 11:13 am
by LeighM
Hi Monie,
That is very strange.
Could you post your generated C file "MIAC PWM TEST.c" and I will see if there are any differences with mine.

If you just have a loop with a delay and OutputON(1) delay OutputOFF(1)
and no PWM, does that give an output?

Also could you check the PWM component has a valid prescaler setting on your project.

Thanks
Leigh

Re: PWM ouput directly from MIAC Arduino

Posted: Fri Nov 18, 2016 11:43 am
by Monie Jacobsen
HI LeighM
Hendes ER C-fil "MIAC PWM TEST.c".
Attached:
MIAC PWM TEST.c
(41.45 KiB) Downloaded 454 times

Re: PWM ouput directly from MIAC Arduino

Posted: Fri Nov 18, 2016 12:18 pm
by LeighM
Hi Monie,

I think the issue is that the default prescaler value for the PWM component is not valid for the ATmega device.
So you need to change it with the drop down list.
pwm_prescaler.jpg
pwm_prescaler.jpg (52.04 KiB) Viewed 9103 times
Hope that helps,
Leigh

Re: PWM ouput directly from MIAC Arduino

Posted: Fri Nov 18, 2016 12:32 pm
by Monie Jacobsen
HI Leigh
OK with the "default prescaler".
I write prescaler manual.

Thank you very much.
GO'Weekend