LJ MAC III 6502 User manual

©LJ Technical Systems
This publication is copyright and no part
of it may be adapted or reproduced in
any material form except with the prior
written permission of LJ Technical Systems.
Issue Number: MP600/C
Written by: LJ Technical Publications Dept.
LJ Technical Systems Ltd.
Francis Way
Bowthorpe Industrial Estate
Norwich. NR5 9JA. England
Telephone: (01603) 748001
Fax: (01603) 746340
LJ Technical Systems Inc.
85, Corporate Drive, Holtsville,
11742-2007, New York, USA.
Telephone: (631) 758 1616
Fax: (631) 758 1788
LJ Technical Systems
MAC III 6502 Microcomputer
User Manual
MP600/C


MAC III 6502 Microcomputer
User Manual Contents
LJ Technical Systems
Chapter Contents Pages
Introduction ..................................................................................................... 1 - 2
Chapter 1 Hardware Description ................................................................. 3 - 4
Chapter 2 Digiac 2000 Connections ............................................................ 5 - 8
Chapter 3 Digiac 3000 Connections ...........................................................9 - 12
Chapter 4 Monitor Functions ................................................................... 13 - 22
Chapter 5 Memory Map ........................................................................... 23 - 24
Appendix 1 Applications Module Programs ...............................................25 - 30

MAC III 6502 Microcomputer
Contents User Manual
LJ Technical Systems

MAC III 6502 Microcomputer
User Manual Introduction
Introduction
LJ Technical Systems 1
The MAC III 6502 is a complete, working microcomputer system based around the Rockwell 6502
microprocessor.
A keypad/display unit may be connected to provide simple memory edit/display and debug
functions, plus direct entry of short programs written in machine code.
For more advanced program development work, the MAC III board may be used in conjunction
with the Merlin Development System, to allow students to design, develop and download programs
written in assembly language using a personal computer (PC).
An optional Applications Module may be connected to the MAC III board. This provides a number
of devices that may be controlled by programs written by the student.
Chapter 1 of this User Manual provides a hardware description for each of the main features of the
MAC III board.
The MAC III board may be connected in one of two ways: in a Digiac 2000 system, or as part of a
Digiac 3000 system. Chapter 2 and Chapter 3 explain how to connect the MAC III board and
related hardware when using these systems. You should refer to the appropriate chapter for the
system you are using.
Chapter 4 provides an overview of the software features of the MAC III board, while Chapter 5
details the programming memory map that will be essential when writing programs to run on the
MAC III.
Finally, Appendix 1 explains how to control the Applications Module using the programs provided
in EPROM on the MAC III board.
The following teaching manual provides further, detailed instruction on developing applications
programs for the MAC III board:
A Introduction to 6502 Microprocessor Applications

MAC III 6502 Microcomputer
Introduction User Manual
2 LJ Technical Systems

MAC III 6502 Microcomputer Hardware Description
User Manual Chapter 1
Chapter 1
Hardware Description
LJ Technical Systems 3
This chapter provides a hardware description of the main features of the MAC III board. A
functional block diagram is shown on the following page.
Microprocessor The MAC III system uses a Rockwell 6502 microprocessor operating at a
clock frequency of 1 MHz.
Monitor EPROM Memory space for 16 kbytes of EPROM is provided. This can be fitted with a
27128 16k EPROM or a 27256 32k EPROM (in this case only half of the
device is used). This EPROM contains the monitor software.
User EPROM A socket is provided for an 8kbyte 2764 type EPROM which can be used for
application programs.
RAM An 8kbyte 6264 type RAM is fitted to the board. This provides 7kbytes of
memory for user programs, the remainder being used for system variables.
User Input/Output A 6522 VIA provides 16 TTL-compatible user input/output lines for
controlling external devices.
Counter/Timer The 6522 also provides two programmable counter/timer channels.
RS-232 Interface A 2681 DUART provides two independent RS232 channels for serial
communication with other devices.
Switched Faults Eight on-board fault switches are provided under a lockable cover. These
allow faults to be switched into the system for fault-finding exercises.

Hardware Description MAC III 6502 Microcomputer
Chapter 1 User Manual
4 LJ Technical Systems
F
unctional Block Diagram for the MAC III board

MAC III 6502 Microcomputer Digiac 2000 Connections
User Manual Chapter 2
Chapter 2
Digiac 2000 Connections
LJ Technical Systems 5
When used as part of a Digiac 2000 system, the MAC III Microcomputer board is powered from a
DT60 Power Supply unit. A DT25 Keypad/display unit may be connected to the MAC III to allow
simple display/editing of memory locations and machine code programming, and the optional DT35
Applications Module provides a range of devices that may be controlled by user programs.
The following picture shows a Digiac 2000 system:
Full instructions for connecting the MAC III Microcomputer board in a Digiac 2000 system, are
provided on the following page.
DT35
Applications
Module DT25
Keypad/display
unit
DT60
Power supply
Microcomputer
board

Digiac 2000 Connections MAC III 6502 Microcomputer
Chapter 2 User Manual
6 LJ Technical Systems
Connecting Power and Keypad/display to the MAC III board
Ensure that the power supply is switched OFF.
Connect the DT60 Power Supply to the MAC III board as shown below.
Note that the power supply cable with the ‘barrel’ connector is used for this
purpose.
Connect the Keypad/display Unit to the MAC III Microcomputer Board as
shown in the diagram.

MAC III 6502 Microcomputer Digiac 2000 Connections
User Manual Chapter 2
LJ Technical Systems 7
Connecting the Applications Module
Ensure that the DT60 Power Supply unit is switched OFF (the power switch is located at the
rear of the unit).
Connect the DT60 Power Supply to the Applications Module as shown below. Note that the
power supply cable with the 5-way connector is used for this purpose.
Connect the Applications Module to the MAC III Microcomputer Board using the two 9-way
ribbon cables provided.

Digiac 2000 Connections MAC III 6502 Microcomputer
Chapter 2 User Manual
8 LJ Technical Systems
Connecting the MAC III board to a student workstation computer
If you are using the Merlin Development System software, then you will need to connect the
MAC III board to your student workstation computer using the RS232 cable provided with
the software.
For further information, please refer to the ‘Getting Started’ manual provided with the
Merlin Development System.
Switching on power to the MAC III board
To apply power to the MAC III board (and to the Applications Module, if connected), switch
ON the power switch located at the rear of the DT60 Power Supply unit.

MAC III 6502 Microcomputer Digiac 3000 Connections
User Manual Chapter 3
Chapter 3
Digiac 3000 Connections
LJ Technical Systems 9
When used as part of a Digiac 3000 system, the MAC III Microcomputer board is fitted onto a
D3000-8.0 Microprocessor Master Board, which is in turn mounted on one of the following
Digiac 3000 base unit options:
•D3000 Experiment Platform (EXP)
•D3000 Virtual Instrument Platform (VIP)
The following picture shows a Digiac 3000 system based on a D3000 Experiment Platform:
Full instructions for connecting the MAC III Microcomputer board in a Digiac 3000 system, are
provided on the following page.
DT35
Applications
Module
D3000
Base unit D3000-8.0
Microprocessor
Master Board
Microcomputer
board

Digiac 3000 Connections MAC III 6502 Microcomputer
Chapter 3 User Manual
10 LJ Technical Systems
Connecting Power and Keypad/display to the MAC III board
Ensure that the base unit Module Power Supplies switch is in the OFF position.
If your base unit is the D3000 Experiment Platform type, you will find this switch on the base
unit front panel. If you are using a D3000 Virtual Instrument Platform, then the switch is
activated from the screen of your PC.
Further information on the Module Power Supplies switch can be found in your base unit
user manual.
Mount the Microprocessor Master Board onto the base unit, and lock it securely in position
using the locking mechanism provided.
Unfold the ribbon cable on the Microprocessor Master Board, so that the connector hangs
over the front edge of the base unit.
Locate the two holes, in the bottom left and bottom right corners of the MAC III board, over
the two brass pins mounted near the bottom edge of the Microprocessor Master Board. The
top part of the MAC III board should rest on the plastic support pillars.
Connect the Microprocessor Master Board to the MAC III Microcomputer Board using the
ribbon cable that is hanging over the front of the base unit.
Connecting the Applications Module
Connect the Applications Module to the MAC III Microcomputer Board using the two 9-way
ribbon cables provided.
Connect the Applications Module Power cable from the Microprocessor Master Board to the
Applications Module, as shown in the diagram opposite.

MAC III 6502 Microcomputer Digiac 3000 Connections
User Manual Chapter 3
LJ Technical Systems 11
Connecting the MAC III board to a student workstation computer
If you are using the Merlin Development System software, then you will need to connect the
MAC III board to your student workstation computer using the RS232 cable provided with
the software.
For further information, please refer to the ‘Getting Started’ manual provided with the
Merlin Development System.
Switching on power to the MAC III board
To apply power to the MAC III board (and to the Applications Module, if connected), switch
ON the base unit Module Power Supplies switch.
Further information on the Module Power Supplies switch can be found in your base unit
user manual.
MAC III 6502
Microcomputer
Applications
Module
PB0
PB7
PA0
PA7
Applications Module
Power Cable
D3000 8.0 Microprocessor
Master Board
(mounted on D3000 Base Unit)

Digiac 3000 Connections MAC III 6502 Microcomputer
Chapter 3 User Manual
12 LJ Technical Systems

MAC III 6502 Microcomputer Monitor Functions
User Manual Chapter 4
Chapter 4
Monitor Functions
LJ Technical Systems 13
The MAC III Microcomputer is supplied complete with a comprehensive monitor program. As well
as initializing the system for operation, reading the keypad and driving the display, the monitor
program provides a range of functions for the user.
The monitor program can operate in either of the following modes:
•Keypad Mode
•Terminal Mode
In Keypad Mode, the user interacts with the monitor program using the 24 keys of the
Keypad/display unit.
For information on how to connect the MAC III board to the Keypad/display, please refer to
Chapter 2 or Chapter 3 of this manual.
If the MAC III board is used in conjunction with the Merlin Development System, the monitor
program can also operate in Terminal Mode. In this mode a personal computer (PC) is connected
to the MAC III board using an RS232 connecting lead. Any commands entered at the PC keyboard
are transmitted to the MAC III board, while the PC screen displays any characters that are output
from the MAC III. In effect, Terminal mode allows the keyboard and screen of the PC to become
the input and display devices of the MAC III board.
The ‘Getting Started’ manual provided with the Merlin Development System provides further
information on:
•Connecting the MAC III board to a PC
•Installing the Merlin Development System
•How to enter Terminal mode
The following pages provide further information on Keypad Mode and Terminal Mode, including
the most commonly used functions. The available options for resetting the MAC III monitor
program are described at the end of the chapter.

Monitor Functions MAC III 6502 Microcomputer
Chapter 4 User Manual
14 LJ Technical Systems
Keypad Mode
When you switch on power in Keypad Mode, the MAC III monitor program will display the
following message on the keypad/display unit:
This message indicates that the MAC III monitor program is ready to receive commands via the
keypad.
The main functions available to the user when the MAC III is being used in Keypad Mode, are
outlined below:
Memory display and edit
This facility allows the user to examine the contents of memory and to edit the contents of locations
in RAM for the entry of machine code programs.
On the first press of the Mkey a 4-digit (16-bit) memory address is displayed. This address can be
altered using the 16 hexadecimal keys. Pressing the M key a second time displays the data at this
address and allows it to be edited using the hex keys once again (the contents of the memory
location are updated as each digit key is pressed). Repeated presses of the M key toggle between
these two functions.
When in memory display/edit mode, the +and –keys may be used to step up and down through
memory. An auto-repeat facility on the keys of the keypad allows the user to scroll through memory
using the + or – key. The longer the key is held down, the faster the display scrolls.
Input/output port display and edit
This facility allows the user to examine and edit input/output ports, such as the 6522 ports. For
example, the user can initialize and write to or read from the User port using the keypad.
Pressing the Pkey allows a 4-digit port address to be entered using the hexadecimal keys. Pressing
the P key a second time displays the data at this port address and allows it to be edited. Due to the
‘write-only’ nature of some port registers, data is only written to the port after the full 8-bit (2-hex
digit) number has been entered.
When in this mode, the +and –keys may be used to step up and down through input/output space.
An auto-repeat facility on the keys of the keypad allows the user to scroll through the port registers
using the + or – key. The longer the key is held down, the faster the display scrolls.
Program run facility
User programs can be executed by pressing the Gkey and entering a 4-digit start address. Pressing
the G key again causes execution to start from this address.

MAC III 6502 Microcomputer Monitor Functions
User Manual Chapter 4
LJ Technical Systems 15
Register display/edit facility
To make it easier to debug programs, a copy of the 6502 registers may be viewed at any time.
Press the Rkey once. The display will show ‘r.’ followed by the register name (in this case ‘PC’
for ‘Program Counter’), followed by the contents of the register. To modify the contents, simply
press the appropriate hexadecimal keys.
To display and modify the other registers, use the +and –keys to step through the list.
Program single step facility
User programs can be single stepped one instruction at a time. After each step, the contents of
memory or the registers can be examined and modified if required.
To single step through a user program, press the Gkey and enter a 4-digit start address. Then press
the +key to single step through the instruction at the specified address.
After the instruction has been executed, the display will show the program counter address (i.e. the
address of the next instruction to be executed), together with an Sto indicate single stepping.
Continue pressing the + key to execute further instructions. The register and memory contents can
be examined and modified at any time using the Rand Mcommands described previously. Having
used either of these commands, press the G key followed by the + key to continue single stepping.
Breakpoint facility
The breakpoint facility allows up to 8 separate breakpoints to be inserted into a program. When a
breakpoint is encountered during program execution, the program is halted and the internal registers
of the CPU can be examined and modified if required. The breakpoint can then be removed and
program execution continued, or alternatively single stepping can start from this point.
Note that:
•Breakpoints can only be inserted into programs running in RAM.
•A breakpoint must be inserted at the address of the start of an instruction, that is at the op code
field and not the operand or data fields.
To insert or remove breakpoints in a program, or just to examine the addresses of those currently
set, press the Rkey twice. The display will show ‘b.1’ (the first entry in the breakpoint table),
followed by the address of the breakpoint. The other seven breakpoints can be examined by
stepping through the table using the + and – keys.
To set a breakpoint, just enter the required address using the hexadecimal keys. Breakpoints can be
set in any order, although it is recommended that breakpoints are inserted into the table in
ascending order, starting with breakpoint b1.
To remove a breakpoint, enter the address 0000 into the table at the appropriate point. Note that the
same breakpoint table is used in both Keypad/display Mode and Terminal Mode.

Monitor Functions MAC III 6502 Microcomputer
Chapter 4 User Manual
16 LJ Technical Systems
Switch to Terminal Mode
If RS232 Channel A of the MAC III is connected to a PC, the user can re-enter Terminal Mode
from Keypad Mode at any time by pressing the RESET button on the MAC III board. The contents
of memory and registers are not affected.
Terminal Mode
When you switch on power in Terminal Mode, the MAC III monitor program will display the
following message in the Terminal window on the PC screen:
The message contains a short list of basic MAC III commands, followed by the MAC: prompt. The
prompt indicates that the MAC III monitor program is ready to receive commands via the PC
keyboard.
The main functions available to the user when the MAC III is being used in Terminal Mode, are
outlined below.
Memory and Input/Output Port display
The ‘m’ command is used to display the contents of memory and input/output ports. For example,
entering the following command:
m 400 [Return]
will cause 80 bytes of memory to be displayed starting from hexadecimal address 0400 (the leading
zero of ‘0400’ does not need to be entered). Note that the memory contents are displayed in both
hexadecimal and ASCII form.
Pressing the [Return] key again displays the next 80 bytes of memory (this is the ‘repeat last
command’ facility).
Table of contents
Popular Computer Hardware manuals by other brands

Atmel
Atmel SMART ATBTLC1000 user guide

Control Data Corporation
Control Data Corporation CDC 40003-22 Hardware Maintenance Manual

HighPoint
HighPoint SRD Series Quick installation guide

Asus
Asus AAEON BOXER-6652 user manual

Texas Instruments
Texas Instruments TPS3813 Q1EVM Series user guide

Renesas
Renesas M30220TF-PRB user manual