Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - help to use time/counter

(you are viewing a thread; or go back to list of threads)

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
Wed Jul 27 2011, 00:19:58
(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.
Wed Jul 27 2011, 10:02:33, download attachment timing.ld
(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.
Wed Jul 27 2011, 16:55:22
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):