Omron C28K Video Game Controller User Manual


 
141
6-3 Calculating Cycle Time
The PC configuration, the program, and program execution conditions must
be taken into consideration when calculating the cycle time. This means tak-
ing into account such things as the number of I/O points, the programming
instructions used, and whether or not Peripheral Devices are employed. This
subsection shows some basic cycle time calculation examples.
6-3-1 Single PC Unit
Configuration: A single C20K CPU.
Program: 300 addresses.
Instructions Used: LD and OUT.
The equation for the cycle time from above is as follows:
Cycle time = Overseeing time
+ Input/output refreshing
+ Peripheral device servicing time
+ Instruction execution time
The overseeing time is fixed at 1.6 ms.
The input/output refresh time would be as follows: 0.51 ms + ( 0.03 ms x N ).
As the C20K is provided with only one input and one output word the value of
the constant N is 0 (i.e. N = 2 – 2 = 0) and so the time required is 0.51 ms + (
0.03 ms x 0 ) = 0.51 ms.
The execution time can be calculated by obtaining the average instruction
execution time and multiplying this by the number of addresses used in the
program. As only LD and OUT are used in this program and they have ex-
ecution times of 12 µs and 17.5 µs respectively, the average instruction ex-
ecution time is:
2
12 µs + 17.5 µs
= 14.75 µs
The total execution time is equal to this average instruction execution time
multiplied by the number of program addresses.
Total execution time = 300 addresses x 14.75 µs = 4.43 ms
The peripheral device servicing time is calculated by adding the other three
time values and multiplying the result by a factor of 0.05. This value is only
required in configurations where a peripheral device is connected to the PC.
The result is calculated as an example. As there are no peripheral devices
used in this example the following results will be ignored in the final calcula-
tion.
Peripheral device servicing = (1.6 ms + 0.51 ms + 4.43 ms) x 0.05 = 0.3 ms
As this is less than 1 ms it must be rounded up to 1 ms. Had it been over 1
ms it would then need to be rounded down to the nearest 0.5 ms.
Calculations
Calculating Cycle Time Section 6-3