Custom Search

68HC11 Parallel Port Operations Lab


1. To learn how to connect to the 68HC11 Input / Output ports.

2. To learn how to use the parallel ports in the strobe mode.

3. To learn basic assembly language programming.

4. To use logic circuits in building a special purpose I/O port.

5. To use the logic analyzer to analyze port signals.


1. Configure the 68HC11 trainer in the single chip mode.

2. Construct an Up - Down Counter using the 68HC11 parallel ports.

a) Connect Port B to an output port consisting of latches (LS75) light emitting diodes (LED), and resisters.

*Note: A latch is a D Flipflop with no clock.

b) Connect Port C to be an input port consisting of a switch and resistor.

c) Write an assembly language program that will count up, 00H to FFH, and down. The count value is output to port B. The input on port C (one bit) will determine if the counter counts up or down. HINT: The microprocessor runs too fast to view the LEDs changing, so a timing loop must be inserted into the program.

d) Run the program full speed (without the timing loop) and verify the operation using the logic analyzer.

3. Connect the parallel ports B and C to a four bit counter with parallel load (
see Experiment 1).

Figure 1: Up-Down Counter Block Diagram

* Where: Strobe B = Load Signal for the 4 Bit Counter
* Where: Clock Signal = Slow Clock = 100Hz to 1kHz

a) The port B outputs should connect to the counter data inputs.

b) The STRB signal should load the counter.

c) The counter outputs should be connected to port C inputs.

d) A strobe signal should be generated in hardware and connected to the STRBA signal. It should have the following characteristics.

- It should be synchronized to the counter clock (function generator).
- It should start immediately after the counter is loaded.
- It should end after the count reaches its maximum value of F.

e) Write a program that will initialize the counter to a value contained in data memory. It will then store this count, and all preceding counts, up to F, in data memory.

f) Demonstrate the program using the MD command and the logic analyzer.

Procedure and Data:

For Parts 1 and 2, put the 68HC11 in single-chip mode and construct an up-down counter using the parallel ports (Port B, Port C).

So, connnect Port B to the output of latches (LS75), the LEDs and resistors.

Then, connect Port C so it is an input port of a switch and resistor.

The program will count up (00H to FFH) 8 bits and down.

Port B contains an 8 bit up-down counter data, and Port C is the switch to count up or count down (1 bit). Note, a latch is a D flip flop with no clock.

So: CTR/Timer, TOC = Timer Output Compare, TIC = Timer Input Capture.

TOC Configuration - Registers:

a) TCNT (TCount) 16 Bit Counter ($100E, $100F)
E Clock = 0.5μs, every 32.768ms the TCNT resets itself

b) Output compare Registers (Total of 5), TOC1 to TOC5. From 1016 to 101F.

Figure 2: Registers Configurations

Lab Notes

Lab Data

Electrical Engineering lab key words: 68HC11, 68HC12, Parallel Port, Microcontrollers, 68HC11, 68HC12, Microcontroller experiments, counter, clock, logic circuits, parallel port, open port, latch, voltage level, looping, data transfer.

Home | Search | Blog | Site Index | Contact Us
Terms & Conditions of Use | Copyright 2007-2010. All Rights Reserved.