Page 1 of 1

PULSE IN A SUBRUTINE WITH FC7

Posted: Fri Feb 09, 2018 1:28 am
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.

Re: PULSE IN A SUBRUTINE WITH FC7

Posted: Mon Feb 12, 2018 2:10 pm
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.flowcode.co.uk/wikiv7/index. ... Interrupts

Re: PULSE IN A SUBRUTINE WITH FC7

Posted: Mon Feb 12, 2018 3:04 pm
by SILVESTROS9
I made a test with IOC-Multiple pins and INT-Single pin interrupts, it helps me enough.Thanks Ben!