Beruflich Dokumente
Kultur Dokumente
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.
Page 2/36
68HC11 Development Board Manual
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.
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,
• 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
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
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
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,
Page 5/36
68HC11 Development Board Manual
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.
Page 6/36
68HC11 Development Board Manual
The quick summary of the Internal and External Memory blocks is shown below,
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.
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.
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
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.
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
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
Page 12/36
68HC11 Development Board Manual
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.
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.
Each of the control registers within the RTC6242 will now be explained in more detail.
Page 14/36
68HC11 Development Board Manual
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.
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.
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
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.
The interface pin connections for the LCD are basically identical for all types, they are explained as
below,
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
Page 18/36
68HC11 Development Board Manual
Page 19/36
68HC11 Development Board Manual
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.
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.
Page 20/36
68HC11 Development Board Manual
Page 21/36
68HC11 Development Board Manual
Page 22/36
68HC11 Development Board Manual
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.
If an external voltage reference is required, the jumper pins need to be opened and an external voltage
reference connected to the CPU.
Page 23/36
68HC11 Development Board Manual
Page 24/36
68HC11 Development Board Manual
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.
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,
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.
Page 25/36
68HC11 Development Board Manual
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.
Page 26/36
68HC11 Development Board Manual
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.
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,
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
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)
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.
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.
;/**********************************/;
;/* 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
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
END
Page 29/36
68HC11 Development Board Manual
'
include "regs11.lib"
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
Page 30/36
68HC11 Development Board Manual
#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 */
/*
#ifdef _HC16
#include "vectrs16.c"
#else
#include "vectors.c"
#endif
*/
Page 31/36
68HC11 Development Board Manual
Page 32/36
68HC11 Development Board Manual
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