Please, give me some advice for a part of the WriteRuntime rutine. (by Noh)
I'm a beginner in the LDmicro and I have a question.
Why this program should go into the loop and be waiting for the interrupt
which occurs after the cycle time?
DWORD now = AvrProgWriteP;
IfBitClear(REG_TIFR, tifrBitForOCF1A);
Instruction(OP_RJMP, now, 0);
Thank in advance!
(no subject) (by Jonathan Westhues)
The ladder logic program gets executed repeatedly, once every cycle time. That's the fundamental way that the ladder logic program gets its sense of time. A timer, for example, is really just a counter that counts up every cycle; with a cycle time of, for example, 10 ms, a time delay of 300 ms is represented as a count of 30.
The micro's timer peripheral is used to measured that cycle time. So every cycle, we execute the program, wait for the next cycle time, and repeat. There's other ways that we could do that timing, but the timer peripheral is convenient.