Sie sind auf Seite 1von 36

68HC11 Development Board Manual

68HC11 Development Board V2.0

Manual

Page 1/36
68HC11 Development Board Manual

Chapter 1. Introduction

1.1 Introduction
This user’s guide describes how to connect to and set-up the 68HC11 Development Board, for
program development using the Motorola 68HC11 and a number of ancillary components. All port
connections are also wired to terminals for connection to other equipment and components. To
understand more about the 68HC11 and the additional IC’s, please refer to their particular data sheets.
Connection and interface information to the various optional devices is given here and you can also
find some sample code snippets on the included diskette.

1.2 Chapter Summary


This chapter describes the uses and purposes for the 68HC11 Development Board. Together
with a description of the computer system necessary for the connection to the board.

1.3 What Is The 68HC11 Development Board


The 68HC11 Development Board utilises the micro-controller MC68HC11 from Motorola as
it’s main processor. The main processor together with it’s ancillary components provide a very
powerful embedded controller, that can be configured to suit most applications. The Motorola 68HC
family is a very widely used controller family and has many derivatives with different memory and
output configurations. More information on this family and it’s various devices can be found at the
Motorola web site www.motorola.com

Figure 1-1: 68HC11 Development Board

Page 2/36
68HC11 Development Board Manual

1.4 Uses For The 68HC11 Development Board


The 68HC11 Development Board will allow rapid program development through pre-prepared
connections to typical components and easy download and modification of program code.
Programs can be developed using Motorola’s development software and then directly downloaded into
the mounted EEPROM. Connection is direct from the computer’s serial port to the Development
Board.

Various components can be easily added to the unit, for code development, together with easy to
connect to header units for connection to external devices.

1.5 Host Computer System Requirements


Standard PC running Windows and Dos software, and also loaded with download program.

1.6 Features of the 68HC11 Microcontroller

The HCMOS MC68HC11 is an advanced 8-bit MCU with numerous on-chip peripheral
capabilities. New design techniques were used to achieve a nominal bus speed of 2 MHz. The MCU
can also operate down to dc, to further reduce power consumption. The MC68HC11 will also execute
all of the M6800 and M6801 instructions, including an additional 91 new opcodes. More information
on these instructions can be found on the various Motorola data sheets. Some feature of the 68HC11
are as follows,

• AVR High Performance and Low Power RISC Architecture


ƒ 118 Instructions – Most Single Clock Cycle Execution
ƒ 32 x 8 General Purpose Working Registers
ƒ Up to 10MIPS Throughput at 10MHz

• Data and Program Memory


ƒ 256 Bytes of RAM
ƒ 512 Bytes of In-System Programmable EEPROM
ƒ Programming Lock

• Peripheral Features
ƒ Eight 8-bit Analog to Digital Convertors
ƒ One serial peripheral interface, with a speed up to 1M
ƒ One Universal Asynchronous Serial Communications Interface (UART)
ƒ Watchdog Timer
ƒ One 16-Bit free running timer, with 3 capture functions and 5 compare functions
ƒ Pulse Accumulator

• I/O and Packages


ƒ 40 Programmable I/O Lines
ƒ 52-pin PLCC

The block diagram of the CPU can be seen below, the 68HC11A1 as used in this development board is
identical to the 68HC11A8 with the exception that is has it’s ROM disabled.

Page 3/36
68HC11 Development Board Manual

Figure 1-2 : CPU Block Diagram

The pin layout of the 68HC11 can be seen in Fig. 1-3. This device has a total of 40 I/O pins that can be
used for a number of dual functions which are set at the start of the program. This can be seen in a
number of examples provided on the CD. Interrupt pins and external memory connections are also
provided. In this development board the program is stored externally in a 24k Byte EEPROM, the
AT29C512, the program is downloaded from the computer using the RS232 connection to the UART
on the main CPU. A further 32 kBytes of RAM space is provided using the 62256 IC also located
externally.

Page 4/36
68HC11 Development Board Manual

Figure 1-3 : Pin Layout for MC68HC11

1.7 Features of the 68HC11 Development Board

The 68HC11 Development Board, also includes a number of supporting IC’s to further
expand the capabilities of the main processor, together with making interfacing and control to a number
of standard auxiliary devices easier. The features of the board are as follows,

• Main Processor MC68HC11A1 from Motorola


• 512 Byte Internal EEPROM within 68HC11
• 256 Byte Internal RAM within 68HC11
• 24 kByte of External EEPROM with AT29C512 for Program Space
• 32 kByte of External RAM with 62256 for Data Space
• 8255 Extended I/O ports
• Standard I/O port for Character and Graphic LCD’s
• Real Time Clock – RTC 6242 with Battery Back-Up
• Line drivers for standard RS232 Communication Port
• Optional Line Drivers for RS422 and RS485 Communication
• 8 Channel, 8 Bit A/D convertors on-board MC68HC11
• Pulse Accumulator and 16 Bit Timer on-board
• Power Supply Regulator and Components on-board

Page 5/36
68HC11 Development Board Manual

Chapter 2. Development Board Memory

2.1 Introduction
The memory within the board is broken up into Internal and External Memory. The Internal
Memory being the memory located within the MC68HC11, whilst the external memory is located in
either the 62256 or the AT29C512. These devices are connected via a bus to the MC68HC11 this can
be seen in more detail on the schematics at the back of the manual.

2.2 Memory Map


The memory map for the board is shown in Figure 2-1. The starting and finishing location of
each memory block is indicated on the right hand side of the memory map. The various sections of the
memory will be further explained in the relevant sections of the manual.

Figure 2-1 : Memory Map

Page 6/36
68HC11 Development Board Manual

The quick summary of the Internal and External Memory blocks is shown below,

Figure 2–2: 8k Memory Blocks

2.2 Internal Memory


The internal memory is broken up into three sections, the Internal Ram, Internal Register
Space and Internal EEPROM. The following discussion will explain each section,

Internal RAM 256 Byte (0000-00FFh)


This is a general purpose memory, which can be used as a temporary store for values and
different registers that will be used during program operation. The values within these locations are
cleared on loss of power. The size of the memory space is 256 bytes and can be moved within the CPU
into 16 different positions. This is done by programming bit D7-D4 of the INIT register.
Example: If D7-D4 of Register INIT is INIT = 0000, the internal RAM is at location 0000h – 00FFh, if
this is changed to D7-D4 the internal RAM will be located at 1000h to 10ffh. Note however when a
reset is done of the CPU this space is allocated to 0000h, and will then be relocated according to the
INIT value during program initialisation. For new users it is not recommended that this value be
changed as it may overwrite certain defined memory areas, that will cause problems during program
execution with values overwritten by other values.

Internal Register Space 64 Byte (1000-103Fh)


This is for the standard registers that are used to control the working parts of the CPU such as
A/D’s, timers, counters, interrupts and SCI,SPI communication. Also the status of various operations
and program execution is kept here. A more detailed description of each register is located in the data
sheet and it is important to have a good understanding of each register, to be able to use the CPU
correctly. The total space of this memory is 64 bytes and is usually located at 1000h to 103Fh, this can
however be moved similarly to the Internal RAM, the same precautions however apply, to prevent
overwriting. To move it to a different location requires the setting of bits D3 – D0 in the INIT register.

Internal EEPROM 512 Byte (B600-B7FFh)


This memory retains it’s value once the CPU is switched off. Thus it is quite useful for storing
of initialising or permanent values. This eeprom is located within the CPU and could be used for initial

Page 7/36
68HC11 Development Board Manual

CPU values. This memory is quite different from the RAM in that to store values here, requires a
number of registers to be initialised with certain values prior to writing to the EEPROM. The write
routine will also take 10mS per byte, similarly for a read byte. To rewrite or overwrite previously used
EEPROM memory locations it is necessary to delete old data prior to writing new data. When deleting
data within the EEPROM all data will be ‘1’ or FFh automatically. The EEPROM working position
will be located at address B600h – B7ffh.

It is also possible to write data by rows rather than a single byte. This will allow 16 bytes to be written
at the same time as it would to write a single byte, using the same routine. It is important the correct
start of row position be specified during this operation. Each row has a starting position, as follows,
B600h – B60Fh, B610h – B61Fh etc.

For writing to the EEPROM, the PPROG register will need to be set accordingly. This register controls
the EEPROM writing routine, and is used to set whether it will be a byte or row write. Similarly for
deleting the data, this register will need to be set accordingly.

Important: The working position of the Internal EEPROM will be the same as the External EEPROM,
thus when writing a program to the EEPROM (address A000h to FFFFh), it is necessary to leave
position address B600h to B7FFh blank, if the internal EEPROM is to be used. If the internal
EEPROM is not required, it can be disabled by fixing the control bit within the CONFIG register. It is
not recommended to make changes here as to correct it, all the present data within the EEPROM and
internal RAM will be deleted, and may affect use of the CPU.

To disable or enable the EEPROM memory, the following steps should be followed.
1. Connect Download Cable to the SCI port and to the RS232 port of the host computer.
2. Press the Load Switch and Reset Switch on the 68HC11 Development Board
3. Release Reset Switch first and then release Load Switch when starting the download.
4. Run program DLCP68V2/D for disable and DLCP68V2/E for enabling of the EEPROM.

2.2 External Memory


The external memory is also broken up into three sections, these are I/O memory for the
various attached devices, Data memory for storing of temporary or data values and finally program
memory for storing of the program instructions.

I/O Memory 256 Byte (1000-1FFFh)


The MC68HC11 has no dedicated area for working with I/O from external equipment /
external IC’s. Therefore it is necessary to dedicate some memory area for this equipment. Various
control values and display values are kept in this area for downloading to the various devices. The
memory area is first dedicated for the internal registers of the CPU, 4 bytes are required here and
address 1000h to 103Fh is used for this purpose. To simplify addressing and control, we have created 8
banks of 512 Bytes each, they are subdivided as follows,

1000h – 11FFh Internal Registers of CPU (1000h – 103Fh)


1200h – 13FFh Programmable I/O (8255 IC)
1400h – 15FFh LCD Control and Data (Character & Graphic LCD)
1600h – 17FFh Real Time Clock (RTC6242)
1800h – 19FFh for Signal to IORQ and other I/O
1A00h – 1BFFh for general purpose
1C00h – 1DFFh for general purpose
1E00h – 1FFFh for general purpose

Data Memory 32 kByte (2000-9FFFh)


The data memory is generally referred to as RAM, and uses the 62256 connected to the main
CPU. The working address is from 2000h to 9FFFh, and can be used for Stack Memory and to record
other data, such as analogue readings, timer values etc.
The EPR/RAM jumper is used to control the size of the EEPROM and RAM. When RAM position is
selected, the RAM will be 32kBytes and the EEPROM Memory 24kB. If the EPR position is selected
the RAM size will be reduced to 24kB and the EEPROM Memory will become 32kB. It is

Page 8/36
68HC11 Development Board Manual

recommended to leave the this switch at the RAM position as to download the program to EEPROM
will require the full 32kBytes of RAM.

Important: When the program is being downloaded to the EEPROM the data RAM will be overwritten
so any data or values stored in this area will be deleted.

Program Memory 24 kByte (A000-FFFFh)


The program memory is stored in the Atmel 29C010 EEPROM IC. Which is an EEPROM
device which can be easily rewritten to, in lieu of an EPROM device which would require ultraviolet
erasing and reprogramming in a separate programmer prior to placement in the board. Further
information on this device can be found in the Atmel data sheet.

In the case of this development board, the program is stored within this device and then called from the
MC68HC11 CPU, the instruction is downloaded from the IC via the bus and then executed within the
CPU. A program counter is maintained within the CPU, such that the commands are called for in the
correct order. Samples of various programs are provided on the enclosed CD, and give a good starting
point for learning how to program this board and other 68HC11 devices.

Page 9/36
68HC11 Development Board Manual

Chapter 3. Input / Output Using the 8255 IC

3.1 Introduction
The 8255 IC has been used on this board to expand the available Input and Output pins. As
can be seen from the schematic for the board. A lot of the available port pins are used for the address
and data bus, to the various IC’s located on this bus. In order to increase the available I/O, we can add a
8255 IC, which is addressable and will provide an additional 3 ports for data I/O. These ports have
been wired to the 72IOZ80 connector located on the right hand side of the development board. A pin
layout is provided at the end of this section.

3.2 Setting Up The 8255


The 8255 has three ports, which are defined as PortA, PortB and PortC. Port A can be a 8 bit
data output/latch or a 8 bit data input latch. Port B can be a 8 bit data output/latch or a 8-bit data buffer,
note here that data is not latched. For Port C it can be identical to Port B with the exception that it can
be divided into two 4-bit ports under mode control. To read/write and control the 8255, we use 4
registers which are mapped to the 8255, these are as follows,

Function Address
Read/Write Port A (PA0..PA7) 1200h
Read/Write Port B (PB0..PB7) 1201h
Read/Write Port C (PC0..PC7) 1202h
Control Word 1203h

Thus to read or write to each port. Firstly to write to the port, we would send a byte to this location and
to read or receive input, it would be necessary to read this location. For example: to send a data word to
Port A, we would do a MOVE instruction to location 1200H.

To set up for different modes of operation, we need to program the Control Word. There are actually 3
modes of operation available for the 8255, these are Mode 0, Mode 1 and Mode 2. We will look briefly
at each mode and how to set it up,

Mode 0 – Is the basic I/O mode where Port A,B and C all operate as basic input and output ports. The
8255 automatically enters this mode after a reset. No initialisation is required to enter this mode. In this
mode Port A and Port B are 8 bit, and Port C is two 4 bit ports. Any port can be input or output and the
input is not latched, with the output latched.

Mode 1 – Is for strobed Input and Output. In this case the data is strobed into or out of the 8255 using
the port C as a control port, for handshaking with the other device. This is typical used in a printer or
disk drive. In this case, there are 2 groups, Port A and Port B, with 4 bits each of Port C used as the
control signals. The data in this case is latched on both input and output.

Mode 2 – Is for Strobed Bi-directional Bus I/O. Data can be sent and received on the same port, which
is Port A. Port B is not used in this mode and can be set to Mode 0 if required. This is useful for
sending data when only one 8 bit data bus is available.

To enter any of these modes, the Control Word will need to be set, this is located at address 1203h. The
control word is broken up into the following parts, as seen in the figure below.

Page 10/36
68HC11 Development Board Manual

Figure 3-2: Control Word Configuration

To operate the 8255, the following bits will need to be set accordingly,

Bit 7 – Mode Set Active, in this case this value will always be 1
Bit 6/5 – Is used to set the mode for Port A, which can be any of the three modes specified
above, Mode 0,1 and 2.
Bit 4 – Used to define whether Port A will be an Input or Output Port, note it is not possible to
define bits as either input or output, the entire 8 bits are either input or output.
Bit 3 – Used to define the upper 4 bits of port C as input or output.
Bit 2 – Used to select the Mode for Port B, in the case of Port B, mode 0 or 1 are only
possible, as per the explanation previously.
Bit 1 – Port B direction, either input or output.
Bit 0 – Port C Lower Bits, port direction, either input or output.

Example: A good example of using the 8255 is as a keyboard or keypad controller. In this
case Mode 0 would be selected. We can then separate Port C to work in two parts. The upper
bytes can be output and set accordingly and the lower bytes as input and set accordingly. We
would then alternatively turn on each bit within the upper section and monitor the input at Port
C lower to determine which key was pressed. In this case a control work of 81h would be
programmed at 1203h and then various bytes would be written to and read from Port C.

The development board has been set up with this feature and a 10 pin connector is available
for direct connection to a keypad. The pin out of this connector can be seen at the end of the
section.

To set different input and output on Port A and Port B, the following bits are set in the control
word as per the below table.

Page 11/36
68HC11 Development Board Manual

Figure 3-3: Setting Input and Output

3.2 Initialising The 8255


When initialising the 8255 at the start of the program, it is necessary to allow some delay as
the CPU will start more quickly than the 8255, so if a control word is sent immediately it may not be
acknowledged or received. Thus it is necessary to allow around 50mS before sending the control word
to the 8255, such that it will be received correctly.

3.2 Pin Diagrams

Page 12/36
68HC11 Development Board Manual

Chapter 4. Real Time Clock

4.1 Introduction
The RTC6242 from Epson supports a number of useful time functions and will keep track of
the date and time, with minimal support. A built-in crystal ensures accuracy and reduces the need for
adjustment. A battery back-up facility is provided and a battery socket for this is provided on the
development board. 12 or 24 hour operation is possible and dates are corrected automatically for leap
year.

4.2 Setting Up and Controlling the RTC


The RTC6242 is initialised and controlled through a series of registers, which are outlined as
in the below figure. To send data to the unit, the address is loaded on the address bus A0 to A3 and the
necessary data is loaded on the data bus D0 to D3. The write pin for the RTC6242 is then pulsed, to
clock in this data. A similar operation is done for reading of the data, with the read pin being pulsed
this time when the address is present on the address lines and the data is then made available after a
certain amount of time. It is recommended to check the data sheet and the timing diagrams for the
various set-up times for these signals. Similarly power-on and loading initial values into the registers,
requires a certain sequence to be followed these are also outlined in the data sheet.

Figure 4-1 : RTC6242 Register Map

Page 13/36
68HC11 Development Board Manual

As the total RTC registers are only 16, only 4 bits are required to specify the address. Since the CPU
address line is actually 8 bit, only the four lower bits D0-D3 are used to send the address. The
remaining bits can be 0. Similarly for the time or data values. The time is also maintained in the RTC
in BCD format, which means for example, the number 12 will be 2 digits, the first digit 1 and the
second digit 2. So it will be necessary to send the first digit to the 10’s register and the second digit to
the 1’s register.

There are also two methods to read or receive data from the RTC. A simple read can be used as
outlined above, or the RTC can be set to generate an interrupt at the end of a fixed period. This is
repeatable, so it is possible to set up the RTC to send an interrupt say every 1 second and then update
the time value within the CPU accordingly. If the bus loading becomes a problem it is possible to
change this interrupt interval, such that the CPU is not receiving and being interrupted so often, this
will allow the CPU to concentrate on other tasks. To send the interrupt to the CPU will require that the
jumper at position IRQ on the development board be installed. If the interrupt is not required, simply
remove this jumper.

Figure 4-2: RTC Socket

Each of the control registers within the RTC6242 will now be explained in more detail.

4.3 Timing Registers


The timing registers are quite straightforward and are outlined in more detail in the data sheet.
The most important point to remember is that to send the information in BCD format and ensure the
data is correct prior to sending, such that out of range values are not sent. This will cause problems in
the operation of the timer and will lead to inaccurate values.

Page 14/36
68HC11 Development Board Manual

4.4 Control Register D


Each bit within this register has a specific function and need to be set according to the
operation required, these bits will now be explained in more detail, they are as follows,

1. Hold Bit – This can be used to hold the value until the value has been completely read from the
various registers. It prevents the problem of a rollover while the value is being read. The time is
incremented within the RTC, but the registers are not updated until the HOLD is released.

2. Busy Bit – This indicates an increment is currently in progress and the various registers are being
updated. The register values should not be read until this busy is clear.

3. IRQ Bit – Indicates an interrupt has occurred, and the corresponding interrupt pin has been set.

4. 30 second ADJ Bit – Will round the time up to the nearest minute when set to 1, after the rounding
is complete and a new value is present at the registers, the bit is cleared.

4.5 Control Register E


This register bits will now be explained in more detail, further information is also available
within the data sheet.

1. Mask Bit – The mask bit together with the STND bit, control the operation of the interrupt pin and
also the pulsed output. This bit needs to be set to 0 to enable the pulsed output and interrupt
signals.

2. STND Bit – This sets whether the output is a fixed pulse signal or is the interrupt signal. A 0 sets
for a fixed pulse and a 1 for a interrupt.

3+4 Timing Bits – These frequency of the fixed interval output or fixed period interrupts is set using
these bits. The lowest frequncy is 1/64th of a second, whilst the maximum is 1 hour.

4.6 Control Register F


1. Reset Bit – This resets the second registers to 0 and will hold these at 0 until the reset is released.

2. Stop Bit – This will stop the counter and can be used if a stopwatch function is required.

3.24/12 Bit – sets the clock for 12 hour or 24 hour operation. In 24 hour operation the hour digits will
then run up to 23, and the AM/PM bit will become inoperative and remain at 0. Enabling this bit allows
the AM/PM bit to operate correctly.

4.Test Bit – This is a test bit for manufacturing testing purposes and should remain at 0.

Page 15/36
68HC11 Development Board Manual

Figure 4-3: Bit Information

Page 16/36
68HC11 Development Board Manual

Chapter 5. LCD

5.1 Introduction
The LCD is one of the most popular tools for displaying various values and status
information. They come in two types, with many different sizes within these types. The most common
is the character LCD, which can display the basic alphabet, together with a few extra characters. The
most common is the 16x2 character LCD. Which is simply space for 16 characters, on each row, with
the number 2 indicating the number of rows. The other type of LCD is the graphic based LCD, which is
basically a mapped space, which will allow any character or picture to be displayed, according to the
information within the memory. Both of these types can be used with the 68HC11 development board.

5.2 Character LCD


The character LCD, normally comes in sizes from 16 to 40 characters per line and 1 to 4 lines.
The operation and programming of them is almost identical, with the exception of the memory space
within the LCD which is of a different size according to the number of characters that are supported by
the LCD. The controller within the LCD is usually the Hitachi HD44780, the 68HC11 microcontroller
will interface with this controller, to first set-up the LCD, and then pass the various values to display on
the LCD. A data RAM is contained within the controller for the display area and the various character
values are sent from the microcontroller to this data RAM.

The interface pin connections for the LCD are basically identical for all types, they are explained as
below,

No. Symbol Definition


1 Vss Ground
2 Vdd Positive Supply +5V
3 Vo Contrast Adjustment (to vary the brightness of the
characters)
4 RS Register Select
5 R/W Read/Write
6 E Enable
7-14 DB0 – DB7 Data Bit 0 to 7
15 Vled Positive Supply +5V for Backlight (if fitted)
16 Vlss OV for Backlight

A backlight is normally not fitted to the LCD, but is available as an option and allows the display to be
read in the dark. For more information regarding the operation and control of the LCD, please refer to
the Hitachi data sheet, which includes information on all the characters that can be displayed and also
explains how to create your own characters. The set-up sequence also has to follow a particular series
of codes with a specified wait time between some operations, some examples of writing to LCD’s is
given on the CD provided.

To connect the LCD to the board, a 14 pin connector can be used. Only the first 14 pins are required for
a character based LCD and the remaining pins can be left unconnected. The wiring from the LCD pins
to the LCD should not be too long, as this may cause signal drop-out due to excessive voltage drop.
The pin description for each pin on the development board connector is shown below. The contrast
adjustment for the LCD, is the small trimpot located to the left of the LCD pins.

Page 17/36
68HC11 Development Board Manual

Figure 5-1: LCD Connector

Figure 5-2 : LCD Connector and Contrast Adjustment

Page 18/36
68HC11 Development Board Manual

5.3 Graphic LCD


The graphic based LCD is somewhat more complicated to control than the character type.
More information on the operation and setting up of these LCD’s can be found in their various data
sheets. The pin arrangement for some graphic LCD’s is as follows, they however vary somewhat and
would recommend referring to the data sheet prior to connecting the graphic LCD.

No. Symbol Definition


1 Vss Ground
2 Vdd Positive Supply +5V
3 Vo Contrast Adjustment (to vary the brightness of the
characters)
4 RS Register Select
5 R/W Read/Write
6 E Enable
7-14 DB0 – DB7 Data Bit 0 to 7
15 CS1 Chip Select CS1
16 CS2 Chip Select CS2
17 RSTB
18 Vout Voltage Out
19 BLA Backlight Positive
20 BLK Backlight Negative

5.4 Address Location


The address location for the various control registers for the devices is as follows,

Type of LCD LCD Data Register


Dot Matrix Control Word Character LCD 1400h
LCD Address Line 1401h
CG & DD RAM 1402h
CG & DD RAM Cursor 1403h
Graphic LCD Graphic LCD Page 2 1404h
Busy Flag, Graphic LCD Page 2 1405h
X,Y Page 2 1406h
X,Y Page 2 1407h
Graphic LCD Page 1 1408h
Busy Flag – Graphic LCD Page 1 1409h
X,Y Page 1 140Ah
X,Y Page 1 140Bh

Page 19/36
68HC11 Development Board Manual

Chapter 6. Serial Communication Interface (Asynchronous)

6.1 Introduction
Within the 68HC11 is a dedicated Universal Asynchronous Receiver Transmitter commonly
referred to as a UART. This is one of the two available dedicated I/O subsystems within the
microcontroller and allows easy interfacing to a computer through it’s serial port. This allows the board
or system to send and receive information using a high level language such as Visual Basic easily and
also allows for the program to be downloaded from a computer to the development boards memory.

6.2 SCI Description


The SCI is a full duplex UART type asynchronous system, using standard non-return-to-zero
format (NRZ – one start bit, eight or nine data bits, and a stop bit). An on-chip baud rate gnerator
derives standard baud rate frequencies from the MCU oscillator. Both the transmitter and receiver are
double buffered: thus, back-to-Back characters can be easily handled, even if the CPU is busy while
data is arriving. The SCI transmitter and receiver are functionally independent but use the same data
format and baud rate. The output from the microcontroller will need to be level shifted, as the standard
for RS232 and RS422 is ± 12V, whilst the output from the microcontroller is +5V. This is done on the
development board with a MAX232 IC. This will also allow the signal to be transmitted a greater
distance, which in the case of RS232 is up to 20m. In the case where longer distances are required, or
multi-dropping is needed, such as in a network, the transmission format should be changed to RS422 or
RS485.

In the case of RS422 and RS485, we are changing from a TTL-SCI line driver, as in the MAX232, to a
TTL-Balance Line Driver, such as the 75176 IC for example. The Balance Line Driver is able to detect
line differences down to as little as 200mV, thus much longer distances can be achieved with this
format. In theory it is capable of up to 10Mbps and a distance of 1200m, however these speeds are
rarely practical due to line capacitances and reflection of the signals. RS422 was designed mainly for
fast peer-to-peer communication being able to send and receive signals over the data line. Whilst the
RS485 system, was designed for a multi-receiver and multi-transmitter network, commonly called a
multi-drop system. The RS485 network is somewhat harder to control, as care must be taken to ensure
signals are not sent simultaneously from a number of points, corrupting the data. So a common call and
respond format is used.

To set up the SCI for operation a number of internal registers within the 68HC11 need to be set, this
includes the baud rate and also for enabling the various Port D pins for correct operation. More
information can be found on this in the Motorola Data Sheet, in section 9.

6.3 RS232 Communication


To communicate between computers and other computer equipment the RS232 data format
has become widespread, and most computers are fitted with a standard RS232 port. Thus this format is
ideal for us to allow communication between the development board and a computer. A RS232 line
driver is already installed on the board, such that a direct connection between the computer serial port
and the CPU 68HC11 is possible. The RS232 connector is located on the bottom left hand corner of the
board, and will accept a 4 pin polarized header, this cable is included with the development board, to
allow the development board program to be downloaded directly into the board’s memory. The pin
configuration is as below.

Page 20/36
68HC11 Development Board Manual

Figure 6-1: SCI Connector

6.4 RS422 Communication


To communicate over longer distances between two devices and at greater speeds, RS422 is
recommended. To change to RS422 communication within the board, the RS232 IC (MAX232) will
need to be removed and 2 SN75176 IC’s inserted in the sockets provided. The connection between the
equipment will also need to be by the 6 pin header provided on the board. This is labelled
RS422/RS485. The 2 IC’s are required for transmission and receiving, with each IC performing one of
these functions. The jumper located above the 75176 IC’s will also need to be set according to either
RS485 or RS422 communication.

Figure 6-2: RS422/RS485 Connector

Page 21/36
68HC11 Development Board Manual

6.5 RS485 Communication


The RS485 communication format allows for data to be sent to a number of other devices on
the same line. For this a single 75176 IC is required and as previously the MAX232 IC will need to be
removed and the 75176 IC inserted in the socket next to the RS232 IC. The jumper will need to also be
set according to the RS485 format required.

Figure 6-3: RS422/RS485 Connector

Page 22/36
68HC11 Development Board Manual

Chapter 6. A/D Converter

6.1 Introduction
Eight Analogue to Digital Channels are available within the 68HC11, each of these has an
accuracy of 8 bits. These pins have been wired directly to a group of pins located at the top right hand
corner of the board. The A/D converter within the 68HC11 uses a all-capacitive charge redistribution
technique for conversions and has a less than ½ LSB accuracy over the operating temperature range.
Because of this charge-redistribution technique, no sample and hold circuits are required and the input
is also able to track quickly changing inputs.

A number of registers within the 68HC11 need to be set, for correct operation of these A/D channels.
This is explained further in the data sheet, together with a detailed explanation of the operation of the
A/D channels.

6.2 Setting Up The A/D Converter


It is possible to adjust the voltage reference values for the A/D converters. Initially these are
set to the supply voltage of the 68HC11, that is +5V and 0V respectively. This is done using the two
jumpers located at the top left hand corner of the board. With the jumpers in place the A/D converters
will use the power supply voltage as the reference. In this case the signal present at the input to the A/D
channels must be within the rang 0 – 5V, if outside this range, damage to the MCU can result.

If an external voltage reference is required, the jumper pins need to be opened and an external voltage
reference connected to the CPU.

Figure 6-1: ADC Connector

Page 23/36
68HC11 Development Board Manual

6.3 Sampling Rate


The sampling rate is determined by the frequency of the clock for the microcontroller. The
sampling actually take 32 cycles, this if a 8 MHz clock is used, with a 0.5uS cycle time. The sampling
rate is 62.5kHz. The nyquist sampling rate should also be considered in the case of a rapidly changing
waveform or if tracking a sine wave. The maximum allowable frequency in the above case according to
this law would be 31.25 kHz. For the sampling it is possible to sample 4 channels simultaneously or to
just sample a single channel. Similarly the MCU can be set up to do a single sample or to sample
continuously and place the results in the appropriate registers.

6.4 Precautions for using the A/D Converters


In the case of using the power supply for the MCU as a voltage reference, care needs to be
taken that no high frequency noise exists on this supply, as this will affect the reading of the input and
give erroneous results. A solution to resolve this problem is to lower the High Voltage reference to
below the power supply voltage and to raise the Low Voltage reference above 0V.

Figure 6-2: ADC Connector

Page 24/36
68HC11 Development Board Manual

Chapter 7. Timer / Counter

7.1 Introduction
The MC68HC11 is fitted with a very versatile 16 bit timer. The timer is based on a free-
running 16 bit counter, with a four stage programmable pre-scalar. A timer overflow function allows
software to extend the timing capabilities of the 16-bit range of the counter. Three independent input
capture functions are used to automatically record (latch) the time when a selected transition is detected
at a respective timer input pin. Five output compare functions are included for generating output
signals or for timing software delays.

7.2 Setting Up and Operation


Numerous registers are needed to control and record various values used by this timer. More
information on these is available in the 68HC11 data sheet. A thorough understanding of these is
needed prior to using this unit effectively.

The connections for the various triggers and output pins from the timer are made available at a 10 pin
connector located near the cpu. The pins are configured as follows,

Figure 7-1: Timer Connector

7.3 Notes
When using the debugger program with the board, the signal at OC5 of the Timer function
will be used as a single step feature by connecting this pin to the interrupt XIRQ of the CPU. Therefore
when the jumper at JOC5 is in position these pins are connected together to enable the operation of the
debugger. If this function is not required, the jumper can be removed.

Figure 7-2: JOC5 Jumper

Page 25/36
68HC11 Development Board Manual

Chapter 8. 40 Pin Z80 Bus

8.1 Introduction
The 40 pin Z80 bus has been designed such that other equipment with a bus type design can
be easily connected to the development board. Clock signals, interrupt signals and address and data
lines are all available on this bus and allow a rapid transfer of data to the attached equipment. A
number of standard boards are available to connect directly to this bus, the include,

1. Input-Output Expansion Board, with 8255 IC. Two types are available with 24 pins and 72 pins.
2. Analog Expansion Board, for both A/D and D/A.
3. Stepper motor controller

For more information regarding these expansion boards, contact Futurlec directly.

The pin arrangement for this connector is as below,

Figure 8-1: Z80 Bus

Page 26/36
68HC11 Development Board Manual

Chapter 9. Downloading The Program

9.1 Introduction
There are a number of different languages that can be used for developing code for the
68HC11 board. These include the most basic assembly code, whose instructions are outlined in the
Motorola manual, there are a number of compilers available for compiling this code available on the
floppy disk and also the Motorola web site. A Basic Compiler and a C Compiler are also available,
some examples of code using these compilers is given at the end of this section. Once the code has
been developed and compiled into hex format it can be download to the board.

9.2 Connecting The Board to the PC


Included with the development board is a SCI or RS232 cable. Which connects between the
board at the SCI/RS232 connector, at the bottom left of the board and the computer serial port, usually
the 9 pin adaptor at the back of the computer. Once this connector is in place we are ready to download
the program.

9.3 Downloading of The Program


Once the cable is in place it is necessary to put the board is receive mode for loading of the
program. This needs to be done as follows, First press the SW-Load button on the development board,
labelled ‘LOAD’ on the bottom right of the board. Whilst holding down this button, press the ‘RESET’
button, which is just below the ‘LOAD’ button. Now, first release the ‘RESET’ button and then the
‘LOAD” button, this will enable the board to receive the program.

Now run the DLCP68V2.exe program from the accompanying CD. This needs to be run in
dos in the following format, after the command prompt,

DLCP68V2 <Filename> /Option

The File will need to be already compiled in Motorola Hex Format, ready for the CPU.

The /Option is used to identify which port is used for the download. There should be no space after the
backslash and it can be

/1 for Com Port 1


/2 for Com Port 2

Com port 1 does not really have to be specified as it is assumed if no value is present that com1 is
used.,

Examples:

C:\> DLCP68V2 TEST8255.S19 (This will download the file TEST8255.S19 from Com1)

C:\> DLCP68V2 TEST8255.S19 /2 (Will download TEST8255.S19 from Com2)

9.4 Enabling and Disabling the internal EEPROM


As discussed earlier, it is possible to enable or disable the internal EEPROM with the 68HC11
cpu. This can be done using the same program, but with a different set of options.

Examples:

C:\> DLCP68V2 /E (Will enable the EEPROM 512 Byte within the CPU, using COM1)

C:\> DLCP68V2 /D /2 (Will disable the EEPROM using the COM 2 port)

Page 27/36
68HC11 Development Board Manual

Important: If the EEPROM is to be used, it is important that the area B600h to B7FFh be left blank
within the program download, as this will result in the EEPROM being overwritten. Is it preferrable if
the internal CPU EEPROM is not required, that it be disabled.

9.5 Example Programs


A number of sample programs are presented here, as a guide to setting up your first program,
the first program is in assembly language and can be prepared using a nornal text editor such as
Windows Notepad. After this is prepared it will be necessary to compile it, this is done using the
following command,

C:\> AS11NEW TEST8255.ASM –L CRES>TEST8255.LST

Once the program has been compiled it can be downloaded as per the previous section. The file
TEST8255.LST will contain the result of the compile and if there is an errors in the code.

Also following is an example using Sbasic and C programming languages.

;/**********************************/;
;/* Demo Program For Output (8255) */;
;/* Hardware : ET-CP68HC11 Ver 2.0 */;
;/* Complier : AS11NEW.EXE (V1.03) */;
;/**********************************/;
;
;/* Address Port of 8255
PA8255 EQU $1200 ; PortA = Output
PB8255 EQU $1201 ; PortB = Input
PC8255 EQU $1202 ; PCL = Input,PCH = Output
CTL8255 EQU $1203 ; Control 8255

ORG $A000 ; Start at ROM Monitor


;
START LDS #$9FFF ; Stack on RAM 32KB
LDX #$1000 ; Base Register Index
;
PSHX
LDX #$FFFF ; Power-on Delay
PWR_DLY DEX
BNE PWR_DLY
PULX
;
LDAA #$80 ; PA,PB,PC = Output
STAA CTL8255
;
OUT_8255 CLRA ; Clear All Output
STAA PA8255
STAA PB8255
STAA PC8255
;
SEC ; 1 00000000 (Carry & Data)
LDAB #9 ; Counter
OUT_PA STAA PA8255 ; Write Data to PortA
JSR DELAY
ROLA ; Rotate Left data
DECB

Page 28/36
68HC11 Development Board Manual

BNE OUT_PA
;
CLRA
STAA PA8255
STAA PC8255
SEC ; 1 00000000 (Carry & Data)
LDAB #9 ; Counter
OUT_PB STAA PB8255 ; Write Data to PortB
JSR DELAY
ROLA ;Rotate Right data
DECB
BNE OUT_PB
;
;
CLRA
STAA PA8255
STAA PB8255
SEC ; 1 00000000 (Carry & Data)
LDAB #9 ; Counter
OUT_PC STAA PC8255 ; Write Data to PortC
JSR DELAY
ROLA ;Rotate Right data
DECB
BNE OUT_PC
JMP OUT_8255

;/*******************/;
;/* Delay Time Sub. */;
;/*******************/;
;
DELAY PSHX
PSHB
LDAB #2
DLY0 LDX #$FFFF
DLY1 DEX
BNE DLY1
DECB
BNE DLY0
PULB
PULX
RTS

ORG $FFFE ; Reset Vector


FDB START

END

Figure 9-1 : Assembly Code Example

Page 29/36
68HC11 Development Board Manual

'

' Example Program Basic Language


' Movlight Function on 8255
'

include "regs11.lib"

const pa8255 = $1200 ‘Address Port A


const pb8255 = $1201 ‘Address Port B
const pc8255 = $1202 ‘Address Port C
const ctl8255 = $1203 ‘Address Control Port
const ctlword = $80 ‘Control Word

declare datashow
declare count

delay:
For Count = 1 To 10000
Next
Return

main:
GoSub delay ‘Power On Delay
pokeb ctl8255, ctlword ‘Control 8255 = Output
datashow = $0101 ‘Data 0101h
Do
datashow = rroll(datashow) ‘Rotate data for display
pokeb pa8255, datashow ‘Output Port A
pokeb pb8255, datashow ‘Output Port B
pokeb pc8255, datashow ‘Output Port C
GoSub delay ‘Delay for Display
Loop ‘loop Continously
End

Figure 9-2: SBasic Example

Page 30/36
68HC11 Development Board Manual

/* Test Outport 8255


By Complier ICC11 */

#include <stdio.h>
#include <hc11.h>
#define PA 0x1200 /* Port-PA8255 */
#define PB 0x1201 /* Port-PB8255 */
#define PC 0x1202 /* Port-PC8255 */
#define PCC 0x1203 /* Port-Control */

void delay(int);
void main()
{
int data_count;
int data_out[8] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
*(volatile unsigned char *)PCC = 0x80;

data_count = 0;
do
{
*(volatile unsigned char *)PA = data_out[data_count];
*(volatile unsigned char *)PB = data_out[data_count];
*(volatile unsigned char *)PC = data_out[data_count];
data_count = ++data_count;
if (data_count == 8)
{
data_count = 0;
}
delay(100);
} while(data_count != 9);
} /* main */

void delay(int dly_time)


{
int dly_count,dly_loop;
for(dly_count = 0; dly_count < dly_time ;dly_count++)
{
for(dly_loop = 0; dly_loop < 255; dly_loop++)
{}
}
return;
}

/*
#ifdef _HC16
#include "vectrs16.c"
#else
#include "vectors.c"
#endif
*/

Figure 9-3: C Example

Page 31/36
68HC11 Development Board Manual

Chapter 10. Power Supply Requirements

10.1 Power Supply


The board will work with a suitable 7 – 12 V dc power supply. It should be able to supply at
least 500mA.

Page 32/36
68HC11 Development Board Manual

Chapter 11. Schematics and Connection Diagrams

11.1 Unit Layout

Page 33/36
68HC11 Development Board Manual

11.2 Schematics

Page 34/36
68HC11 Development Board Manual

Page 35/36
68HC11 Development Board Manual

Page 36/36

Das könnte Ihnen auch gefallen