PWM ouput directly from MIAC Arduino

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

PWM ouput directly from MIAC Arduino

Post 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 403 times
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PWM ouput directly from MIAC Arduino

Post 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
Attachments
MIAC PWM TEST.fcfx
(7.74 KiB) Downloaded 388 times

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: PWM ouput directly from MIAC Arduino

Post 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
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PWM ouput directly from MIAC Arduino

Post 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

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: PWM ouput directly from MIAC Arduino

Post by Monie Jacobsen »

HI LeighM
Hendes ER C-fil "MIAC PWM TEST.c".
Attached:
MIAC PWM TEST.c
(41.45 KiB) Downloaded 413 times
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PWM ouput directly from MIAC Arduino

Post 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 8543 times
Hope that helps,
Leigh

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: PWM ouput directly from MIAC Arduino

Post by Monie Jacobsen »

HI Leigh
OK with the "default prescaler".
I write prescaler manual.

Thank you very much.
GO'Weekend
Best Regard
Monie

Post Reply