PULSE IN A SUBRUTINE WITH FC7

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

Moderator: Benj

Post Reply
SILVESTROS9
Posts: 115
Joined: Wed Aug 03, 2016 10:45 pm
Has thanked: 24 times
Been thanked: 11 times
Contact:

PULSE IN A SUBRUTINE WITH FC7

Post by SILVESTROS9 »

Hello to all!
In a FC7 code for a MCU, sometimes there is a need to have an accurate digital pulse(in the area of microseconds) in an output pin with defined duty cycle.How can I realize that without use delay command, to avoid command execution time delays? Also how can I use a part of code as subrutine that I can call many times in a code loop? In my case , I would like to scan 30 input pins of MCU one after one (with defined interval time) for HIGH or LOW , and have at the same time that input states to 1 output pin as serial pulses with as soon as possible lower delay time. Thanks.

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: PULSE IN A SUBRUTINE WITH FC7

Post by Benj »

Hello,

Have you tried using a timer interrupt? Sounds to me like it may be the best way to do it.

The software based PWM example at the link below may be useful.
https://www.matrixtsl.com/wikiv7/index. ... Interrupts

SILVESTROS9
Posts: 115
Joined: Wed Aug 03, 2016 10:45 pm
Has thanked: 24 times
Been thanked: 11 times
Contact:

Re: PULSE IN A SUBRUTINE WITH FC7

Post by SILVESTROS9 »

I made a test with IOC-Multiple pins and INT-Single pin interrupts, it helps me enough.Thanks Ben!

Post Reply