help to use time/counter (by Ronaldo martins)
I need help to make next step:
APLICATION 1 (once time)
1- out1 ON for 3s
2- out2 ON for 4s
3- out1 ON for 2s
Aplication2 (loop)
1 - TIME1=0x00
2 - TIME1=10 out1 ON for 2s
3 - TIME1=20 out2 ON for 3s
4 - TIME1=25 out1 ON
STOP
Regards
(no subject) (by Jonathan Westhues)
Attached find one possible way to code this. In the first three rungs, the sequence that you describe begins on the rising edge of the input Xin. That rising edge is converted to a single-cycle pulse with a one-shot-rising instruction. That pulse, feeding in to a 3 s turn-off delay, produces the first step. That same pulse, feeding in to a 7 s turn-off delay, produces the second step, after getting delayed by 3 s by the turn-on delay. The third step is analogous.
For the second application, it's not clear what you want; you indicate that you want to set out1 in step 4, but not for how long. (It can't be indefinitely, or else step 2 wouldn't do anything.) So I arbitrarily guessed 500 ms.
In any case, one way to code that is with a counter advancing once per second, The events are triggered off the timer count, and the pulse lengths are determined by turn-off delays as before.
(no subject) (by Ronaldo)
Jonathan Westhues,
Thank you very much for your attention and your reply.
I assembled a board with ATMEGA32 after testing I will post the results soon.
Best regards.