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 - Cycle time

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

Cycle time (by Fernan from Philippines)
8/25/09

Hi there! Me Again!

I would like to ask, how past in milliseconds (ms) does a PIC cpu perform a scan time on every rung. crystal is 20mhz?

How many rungs can a PIC mcu accomudate? Before it fails to read?


Thanks! More Power!
Tue Aug 25 2009, 09:20:10
(no subject) (by Jonathan Westhues)
Some instructions take longer to execute than others. For example, contacts and coils are very fast, but a multiply or a divide is slow. So it's not possible to say exactly how long a rung takes to execute.

The cycle time in LDmicro is always user specified (Settings -> MCU Parameters). If you make the cycle time longer, then you can execute more rungs within that time. LDmicro won't warn you if your program takes longer to execute than the specified cycle time; your timing will just be wrong.

There's also a limit due to the processor flash size. LDmicro will warn you if you exceed that one.

With typical clocks speeds (~20 MHz) and cycle times (~10 ms), tens or hundreds of instructions should be no problem. If you do have trouble, then try increasing the cycle time.
Wed Aug 26 2009, 00:48:36
(no subject) (by David R)
Hi just to add to this,

If I am trying to do fast scan times I test the speed
of the program by connecting An output coil to a contact (negated) and let it pulse. I then connect me scope to the output and time the pulse, Increase the cycle time until the pulse does not happen any quicker and that is full speed.
After that set the cycle time A bit longer and every thing works well.
Regards
David
Wed Aug 26 2009, 16:26:59
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):