EER-018
Introduction to Digital Computers
 Lecture 26

Instruction timing

For the 6805 chip, maximum internal clock freqeuency is 2.1 MHz.
Frequency, F = 2.1 x 106 1/s
Clock period, T = 1/F = .5 x 10-6 = 500 x 10-9 = 500nS = time of 1 cycle.

How long does the following loop take to execute?

        CLRX        ; 3 cycles
loop    DECX        ; 3 cycles
        BNE loop    ; 3 cycles
 

An example program - planning, documentation

Write a program that will read the state of an input switch connected to bit 0 of port A. If the switch is pressed (a "1" is read on bit 0 of port A) then we will turn on an LED attached to bit 7 of port A for about one second, then turn it off until the button is released and pressed again.