Page 1 of 1

Dealay on output PIC16F887

Posted: Wed May 24, 2017 2:16 pm
by alens
Please,
Is it possible use delay icon to delay output change after the triger event (set or reset LED, relay = function TON or TOF) without slowing program execution speed?
Microcontroller PIC 16F887, FC7.

Re: Dealay on output PIC16F887

Posted: Wed May 24, 2017 2:40 pm
by medelec35
You could use a timer interrupt for a delay instead of a delay icon?
What delay time are you thinking of?
Take a look at this post.
If you get stuck then post your flowchart for further help.

Martin

Re: Dealay on output PIC16F887

Posted: Wed May 24, 2017 4:21 pm
by alens
Martin, this is still a big task for me.

Change the voltage in range 0-5V at input RA0 illuminate LED1-20. I attach a flowchart.

In case of a rapid change of the voltage on RA0, the light from the LED may not be visible. That's why I want to deactivate every diode with delay by approx. 200ms.
That means using 20x delays before each TurnOff component.
During a delay, the user program is not running. Short voltage pulses will not be displayed.

Thank you.

Marian

Re: Dealay on output PIC16F887

Posted: Thu May 25, 2017 10:50 am
by medelec35
Hi Marian,
Hopefully this should work (untested on hardware) the way you want it to.

Martin.

Re: Dealay on output PIC16F887

Posted: Thu May 25, 2017 9:28 pm
by alens
Great Thanks Martin for showing the way to the solution.

Marian

Re: Dealay on output PIC16F887

Posted: Fri May 26, 2017 7:39 am
by medelec35
Your welcome.
Can you let us know it it works the way its intended to please.

Martin

Re: Dealay on output PIC16F887

Posted: Fri May 26, 2017 9:17 pm
by alens
Martin. It seems to work well. With rapid change of voltage at RA0 input, the LEDs will turn on quickly and will go out with a short delay.

I have to study the program from you to understand how it works.

A few years ago I bought Flovcode V5. Something I have programmed for PIC 8 bit, but I have not worked with him yet. I am now testing the new version of Flowcode V7.

In the meantime, I have been working on industrial PLCs in structured text and lader diagrams. That's why in Flowcode 7 I was intuitively looking for the TON, TOF timer icon so, that the delay is related only to the selected event (output changes) and did not slow the execution of the program.

Thank you Martin.

Marian

Re: Dealay on output PIC16F887

Posted: Sat May 27, 2017 12:43 am
by medelec35
Glad it's working for you.
Thanks for letting me know
If you get stuck with working out how it works, I can assist you further.

Martin