Page 162 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 162

Introduction to Microprocessors


                  Notes
                                                     Figure 11.6: Offset and Non-Offset Branching

























                                 11.3 Time Delays

                                 A special class of electromechanical relays called time-delay relays provide delayed action, either
                                 upon power-up or power-down, and are commonly denoted in ladder logic diagrams by “TD”
                                 or “TR” designations near the coil symbols and arrows on the contact symbols. Here is an example
                                 of a time-delay relay contact used in a motor control circuit:

                                                             Figure 11.7: Time Delays












                                 •  Knowing the combinations of cycles, one can calculate how long such an instruction would
                                    require to complete.
                                 •  Knowing how many T-States an instruction requires, and keeping in mind that a T-State is
                                    one clock cycle long, we can calculate the time using the following formula:
                                    Delay = No. of T-States / Frequency
                                    For example a “MVI” instruction uses 7 T-States.

                                 Therefore, if the Microprocessor is running at 2 MHz, the instruction would require 3.5 mSeconds
                                 to complete.

                                 •  We can use a loop to produce a certain amount of time delay in a program.
                                 •  The following is an example of a delay loop:
                                    MVI C, FFH 7 T-States

                                    LOOP        DCR C 4 T-States
                                    JNZ LOOP    10 T-States





        156                              LOVELY PROFESSIONAL UNIVERSITY
   157   158   159   160   161   162   163   164   165   166   167