Interfacing and Communicating With The 68Hc05/705 Microcontroller Family

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

INTERFACING AND COMMUNICATING WITH

THE 68HC05/705 MICROCONTROLLER FAMILY


This document provides information necessary to interface the Andromeda Research EPROM+ programming system to certain
members of the Motorola 68HC05/705 microcontroller family. The interface is accomplished using the ACOM1 adapter by up-
loading a small communication program into the RAM area of the 68HC05 device. Once uploaded, the program establishes a
communication link between the 68HC05 and the EPROM+ system. The communication program allows the EPROM+ system ac-
cess to the internal EPROM, EEPROM, ROM, RAM or I/O area of the part.

ABOUT THE 68HC05 FAMILY


The 68HC05 microcontroller family is composed of more than 100 different members (parts). These include limited function de-
vices in small packages intended for simple applications plus complex devices intented for more sophisticated products. All family
members use the same basic processor core and differ only in the amount of memory (ROM, EPROM, EEPROM and RAM) plus
peripheral options such as I/O ports, timers, counters, pulse width modulators, comparitors, etc. NOTE: Motorola identifies parts
containing user programmable EPROM with 705 in the part number as opposed to 05. For example, the 68HC705C8 microcontrol-
ler has user programmable EPROM where the 68HC05B16 has factory programmed mask rom. This document does not address
the specific technical attributes of any member of the 68HC05 family. If you require information regarding a specific part it may be
obtained from the Freescale website (www.freescale.com). Motorola spun off their microcontroller division and changed the name
to Freescale. NOTE: This document uses the $ which is Motorola’s standard syntax for represending hexadecimal numbers. Ex-
ample: $100 represents 100 hexadecimal.

COMPATIBLE FAMILY MEMBERS


The EPROM+ system is compatible with members of the 68HC05 family which support the following internal architectural com-
ponents and chip features:

1 - SCI port (Serial Communication Interface)


2 - 176 bytes of internal RAM mapped at $0050.
3 - Load program into RAM and execute function (binary image program only loaded at $0050).

NOTE: Some members of the 68HC05 family do not support the function which allows a binary program to be loaded into the
RAM area at $0050 and executed. If this function is not supported, the communication program upload will fail. An example part
which does not support the binary upload function is the 68HC705B5.

REQUIREMENTS FOR SUCCESSFUL UPLOAD AND COMMUNICATION


In order for the 68HC05 microcontroller to accept and successfully upload the communication program the following conditions
must exist:
1. The part must be powered on (5volts applied).
2. The part must be configured to accept the uploaded program. This differs depending on the part. There are two example sche-
matic diagrams included with this document. One illustrates the necessary connections for the 68HC705C8 and the other the
68HC05B16. Example: The 68HC05B16 must have the following pins at logic 1 (+5) following reset. (PD3 and TCAP1). The
PD4 pin must be at logic 0 (GND). The IRQ pin must have between 9 and 10 volts DC applied. If any of these conditions are not
met, the part will not enter the bootstrap or upload mode following reset.
3. The part must be clocked or running from a 4 MHZ source. This can be an external crystal or a dedicated crystal oscillator. This
frequency must be insured or the proper baud rate (9600) for communication will not be generated.
4. The ACOM1 must be connected such that the RST (reset), XMT (transmit) and RCV (receive) pins are connected to the proper
pins on the 68HC05.

SELECTING THE PART


The EPROM+ system requires that you choose a specific part number depending on the task you wish to perform. Due to the lim-
ited RAM in a 68HC05 device, it is not possible to provide a single communication program which allows programming of both
the EEPROM and EPROM. To this end, there are two communication programs, one contains the algorithm which allows you to
read and program the on-chip EEPROM area, the other contains the algorithm which allows you to read and program the EPROM
area. The correct program is uploaded depending on the part number you choose. There are four part numbers available, two de-
vice specific and two generic. The device specific part numbers are the 68HC05B16 (EEPROM) and the 68HC705C8 (EPROM).
The two generic part numbers are the 68HC05EE (EEPROM) and the 68HC705EP (EPROM). In the event that you are working
with a part which is not a 68HC05B16 or a 68HC705C8, you may choose the corresponding generic number depending on the task
you wish to perform (EEPROM or EPROM access and programming).
UNDERSTANDING THE EEPROM AND EPROM DIFFERENCES
EEPROM MODE (68HC05EE) - Choosing the 68HC05EE will upload the communication program which allows reading and
programming of the EEPROM area of a 68HC05. In the normal 64K address range ($0-$FFFF) of a 68HC05 part with on-chip
EEPROM, the EEPROM will be mapped between $100 and $1FF (256 bytes). The EPROM+ software makes this 256 byte block
of memory appear to begin at address $0 and end at address $FF. This is done to allow you to work with the EEPROM area within
the part unencumbered by the fixed offset of $100. When you instruct the system to read, the EEPROM area will be loaded into the
system buffer beginning at 0 and ending at FF. Conversly, when you instruct the system to program, the buffer area between 0 and
FF will automatically be placed into the part between $100 and $1FF.

EPROM MODE (68HC705EP) - Choosing the 68HC705EP will upload the communication program which allows reading and
programming of any EPROM area of a 68HC705. You are actually permitted access to the entire 64K ($0-$FFFF) address range as
there is no consistent block of memory allocated only to EPROM in the 68HC05 family. When accessing a 68HC705 or 68HC05
part, you may examine any address within the 64K range. In order to program the EPROM area you must apply the required exter-
nal programming voltage to the Vpp pin on the processor. For the 68HC705C8 device, the is 14.75 volts. The buffer editor “W”
(write) command must be used to write the data from the buffer into the 68HC705 over the desired address range.

STANDARD MEMORY READ/WRITE


While in the EPROM MODE (68HC705EP), you may also perform standard memory read and write operations. These are the
same as processor LOAD and STORE instructions. This allows you to exercise I/O ports or examine and change any address
within the 64K range. To select this option press “Z” at the “SELECT COMMAND” prompt. Select “O” for options then press “3”
to choose the entire 64K address range. Press “O” for options and choose “1” for memory write. Press “ESC” twice to return to the
COMMAND PROMPT. You may now use any main or editor command to read or write the device. NOTE: If you wish to work
with the EEPROM area (68HC05EE) while in the 64K mode, use the previous option selections except choose “2” “EEPROM
ALGORITHM” instead of “1” (memory write).

UPLOAD SEQUENCE AND OPTIONS


Before any operation can be performed on the 68HC05/705 the appropriate communication program must first be uploaded. To
achieve a successful upload, the conditions listed under REQUIREMENTS FOR SUCCESSFUL UPLOAD AND COMMUNICA-
TION must exist. Once these conditions are met, perform the following steps:

1 - From the COMMAND PROMPT press “Z” (device options)

2 - Press “1 - UPLOAD 68HCXX COMMUNICATION PROGRAM”


You will see: “BOOTSTRAP UPLOAD IN PROGRESS...”
3 - When the upload is finished your will see “* BUFFER UPLOAD COMPLETE *”

4 - The EPROM+ software will now attempt to confirm that communication can be established with the 68HC05.
If communications is established you will see (COMMUNICATION VERIFIED) displayed directly below * BUFFER UPLOAD COMPLETE *. Watch for it. If the
COMMUNICATION VERIFIED message is not displayed, communication with the 68HC05 part has not been established and no system commands will function.
If this happens, you must determine the cause and correct the problem. Note: The * BUFFER UPLOAD COMPLETE * and (COMMUNICATION VERIFIED) mes-
sages are displayed for a short period and then automatically erased.

ADDITIONAL CONSIDERATIONS
1. The communication program will continue to run in the 68HC05 until power is removed or the processor is reset. Remember
that if you temporarily remove power from the part, you must again upload the communication program.
2. The communication program loads and runs in the 68HC05 RAM area beginning at $0050. If you use the memory write function
of the program to alter any addresses in this area, you will corrupt the program and communication will stop.

UPLOAD ANY TEST PROGRAM INTO THE 68HC05 RAM AREA


If you have the technical skill to create your own test program and wish to upload it into the 68HC05 part, this can be accom-
plished by pressing “Z” and choosing option 2 or 3. Create your program with the ORIGIN at $51. Load the program into the
buffer and then transfer it (“T” command) to buffer address 0001. Count the total number of bytes plus 1 and place this number (in
binary) at buffer address 0 (byte count). Upload your program. NOTE: The binary image structure of the program follows:
$50 - byte count of program including this byte (if you have a five byte program this value will be $06)
$51 - First byte of program (execution starts here)
$52 through $FF (remaining bytes in 176 byte area)
NOTE: When the processor starts from reset, it places the STACK at $FF. Be aware of this as it can limit the available space for
your program depending on the use of subroutines.

You might also like