Jul AUG Sep
Previous capture 27 Next capture
2015 2016 2017
1 capture
27 Aug 2016
About this capture
MEK6802D3 Manual

Chapter 1 - General Description and Operation

1.0 General Description

The MEK6802D3 board (see Figure 1.0.1) is designed to be a single board microcomputer, for use in both the educational environment and for computer based system applications.

This system employes the MC6802 microcomputer chip. It also contains 256 bytes of user RAM (MCM681O) and 128 bytes of operating system (OS) stack. The operating system software (called D3BUG) is contained in the 2K bytes of Read Only Memory (ROM) storage of the MC6846. The keyboard and eight seven-segment displays are used in conjunction with D3BUG to enter and debug user programs. The I/0 port of the MC6846 is accessible through a 16 pin socket for external control of user defined applications such as timers, relay control, etc.

Provisions are made for system expansion through the system bus. The D3BUG operating system is expanded by 2K bytes (MCM68316) to accommodate additional features and commands necessary for the expanded system. Also the system bus has additional signals to support eight levels of memory paging. Hence, the expanded operating monitor with 100% memory decoding and paging can make the MEK6802D3 a very flexible and powerful computer system.

[Figure 1.0.1 Insert image of board]

1.1 Address Space (stand-alone computer)

The address space organization of the MEK6802D3 computer board is given in the address map blow. Chapter 3 gives a functional description for the address space configuration for an expanded system.

F800FFFFMC6846 ROM: D3BUG
818081FFMCM6810 RAM: User stack; Optional user stack - relocatable from $0080
8100817FMCM6810 RAM: D3BUG Operating system stack
8088808BMC6821: Keypad/display PIA
80808087MC6846: I/O - Timer
008000FFMCM6810 RAM: User stack - relocatable to $8180
0000007FMC6802 RAM: User stack - can be disabled when using off-board memory

1.2 Firmware Features

The 2K firmware monitor for the MEK6802D3 microcomputer system, D3BUG, resides in the MC6846. The function of the monitor is to provide a means for communication with and control of the system microprocessor by using the keyboard and display. D3BUG has the following capabilities and features:

  1. Examine and change memory locations with ability to increment to next location or decrement to previous location.
  2. Automatically verify memory change by displaying both the digits entered and the actual contents of memory.
  3. Display and change MPU registers.
  4. Calculate offsets for branch instructions.
  5. Single step trace of programs in both RAM and ROM.
  6. Set, clear, and examine up to 8 breakpoints.
  7. * Punch designated memory to audio cassette using the expansion I/O board, MEK68I0, at either 300 or 1200 baud rate.
  8. * Load cassette tape into memory.
  9. * Verify tape after punching or loading.
  10. Go to and execute user program.
  11. Abort user program.
  12. Execute any keyboard control functions during execution of user program.
  13. User definition of each of the hexadecimal keys to correspond to a user program.
  14. Optional user definition of interrupt vectors.
  15. Access to monitor subroutines for user programs.

* Features 7, 8, and 9 can be used in an expanded system with a MEK68I0 board.

1.3 Preparation For Use

The MEK6802D3 requires a single +5 V power supply (5% tolerance) with a maximum current capacity of 0.9 amps. The kit comes with a 5 pin contact wafer assembly which can be used to attach the power through the PC board connector. Two wires (at least 22 gauge) must be soldered to the contact wafer assembly as shown in Figure 1.3.1.

The 5 pin contact wafer assembly pins are accessable at both ends and the two wires are soldered to the short pin side. The longer pin side is mated to the PC board connector (pins 1-5) as noted in Figure 1.3.1. To insure that the soldered wires do not short to other pins, it is recommended that sleeving is used on the two soldered pins.

Before the power suppìy is connected to the PC board, be sure that the surface that is to support the D3 card is a non-conductive material such as wood. Next, make sure that the power supply is off before connecting the connector' assembly to the PC board.

1.4 Start Up Procedure

When the power supply is switched on, a prompt sign (=) shouîd appear in the left most display (marked 1 in Figure 1.3.1) and the remaining displays should be blank. If the display does not come up in this mode, press the RS button on the keypad. When RS is depressed momentarily, the display should go to the state described when power was first turned on. If the display registers something different, then turn off the power supply and check for proper connection and continuity of the power connector. A1 so check to make certain that the power supply is within the specified +5 V +/-5% range.

When the power is on and all displays blank except the prompt sign (=), the monitor (DBBUG) firmware is now in operation and any of the functions described in the next section may be invoked by means of the data and comnand keys of the keypad.

[Figure 1.3.1]

1.5 Operating Procedure

The keypad/display, in conjunction with D3BUG provides examine operations for the computer and entering and trouble-shooting of programs. The keypad has sixteen keys labeled 0 - F for entry of hexadecimaï data and nine keys for commanding the following functions.

RS- System Reset
M- Memory Display
G0- Go
EX- Escape
FS- Special Function
T/B- Trace/Breakpoint
RD- Register Display
P/L- Punch/Load
FC- Clear Special Function

Operating procedures for each of these functions are described in the following paragraphs with the exception of the P/L operation which will be covered in detail in Chapter 3.

RS : Reset key re-initia1izes the monitor and places a (=) prompt on the display.

M : The memory display key is used to display and alter data stored in memory. The function is invoked by entering the hex address and depressing the M key. The first four displays provide the address.

The middle two displays will contain any hex numbers which may be entered by the user. The far right two displays will show what is stored at that address. If the address is not in RAM, the far right display may not be the same as the middle display. To step towards high memory, type G0 and the next higher memory location will be displayed. To examine a previous memory location, type M and the previous memory location will be displayed.

The memory display function contains a subfunction which calculates offsets for 6800 branch instructions. To use it in the memory display function, type FS and the display 'A' appears prompting for an address. Enter the desired branch address and type G0. The display will return to memory display. If a legal offset was calculated, it will be displayed in both data displays and stored at the proper location. If an offset out of range was calculated, an FF will be displayed in the middle two LEDS and the data in RAM (as displayed in the 1ast two LEDS) will not change. If no RAM is at the displayed address, the offset will be displayed in the middle two LEDs only. To re-enter the monitor from the memory display, type EX and the prompt (=) will appear.

GO: The G0 key allows the user to execute his programs. To use, enter the programs starting address and type G0. If any break-points have been set, they are placed into the user's program and are removed when a breakpoint is encountered. If the user wishes to abort type EX. If the program is aborted or ends in any other than executing a breakpoint, the breakpoints will not ‘i be removed.

EX: The escape key is used to re­enter the monitor from any of the commands or from the user's program. The EX key does not change the breakpoints that have been previously entered.

FS: Special Function Key converts all hex keys, P/L, and T/B to alter- nate function keys. The P/L key causes the load from tape operation to occur. The T/B key allows breakpoints to be entered. The hex keys are defined by the user who must create a jump address table and place the starting address of that table in UHASH ($8102); a display '= FS' appears when FS is typed in the prompt mode. The $ symbol signifies that the number is hexadecimal.

FC: Clears the special function mode and removes the ‘FS’ from the display.

T/B: The Trace/Breakpoint key is used to cause single step traces or for Inserting/Displaying/Deleting breakpoints. The Trace function executes one instruction in a program and displays the registers at the end of execution. The registers may then be modified as desired. The user may trace through all the 6800's instructions including the SWI instruction. When an SWI is encountered, the the Trace continues in the user's software interrupt routines. This enables the user to test his interrupt program by placing a SNI instruction in his program and storing the interrupt address at USWIV ($8108) Trace also allows the user to trace through a program stored in ROM. To use the Trace function, type RD, enter the address of the instruction in the program counter, and type T/B. The user may trace through as many instructions as are needed. If it is desired to execute the program from the display address, type G0. To return to the monitor type EX.

The breakpoint function allows the user to set up eight break- points and it allows the user to edit any breakpoints which already exist. Breakpoint addresses are stored in a sequential table along with the op-code at that address. Breakpoints are entered into the user programs when the GO key is typed and removed when a breakpoint point occurs. If any other method is used to return to the monitor, i.e. a jump, the breakpoints will not be removed. To use the breakpoint function type FS and T/B. If this is the first time into the function, the display will be '0000 0' for no breakpoints. Enter the address of the desired breakpoint and type FS. For example: we wish to place a breakpoint at $5000. Type FS and T/B. The display is '0000 0' enter $5000 and depress FS; the display is now '5000 1'. This may be repeated until an '8' is display in the far right side.

To display the breakpoints that have been set, type GO. The breakpoints will be displayed one at a time starting with the first breakpoint entered and will repeat until all the breakpoints have been displayed. when the breakpoint function is reentered at a later time, the breakpoint that was entered first will be displayed first and the rest will be displayed in the order' that they were entered.

To remove a breakpoint, step to the breakpoint that is to be removed with the G0 key and type FC. The breakpoint entry is removed from the table, the table is compressed, and the breakpoint count decremented by one. One or all of the breakpoints may be cleared in this way. To clear all the breakpoints, push the RS (reset) key. Breakpoints may be set at any address in RAM memory. Breakpoints can not be used in a program stored in ROM.

RD: The register display key allows the user to display and modify the user's registers. To display the program counter, type RD and a display appears. This display breaks down as follows: the first four hex characters are the address in the program counter, the next two are the byte at that address, and PC stands for the program counter. The rest of the registers may be displayed one at a time by pressing the RD key. The registers are displayed in the following order:

Program Counter(PC)
Index Register(1d)
Accumulator A(AA)
Accumulator- B(Ab)
Condition Code Register(CC)
Stack Pointer(SP)

The user may trace the instruction indicated by the PC by typing T/B. The next instruction will appear and the user remains in register display. The user may continue execution of his program by typing G0. To return to the monitor, type EX.

In order to better understand the keyboard commands of D3BUG, the following examples are given:

Example 1: Assume you want to examine the contents of address location $F957.

  1. Enter D3BUG by typing RS. The prompt should appear in the left most display with the remaining displays blank as illustrated.
    Address FieldKey Data FieldRead Data Field
    =       
  2. Type F
    Address FieldKey Data FieldRead Data Field
    000F    
  3. Type 9
    Address FieldKey Data FieldRead Data Field
    00F9    
  4. Type 5
    Address FieldKey Data FieldRead Data Field
    0F95    
  5. Type 7
    Address FieldKey Data FieldRead Data Field
    F957    
  6. The desired address is now entered, and to display the contents of this address type M.
    Address FieldKey Data FieldRead Data Field
    F9570303

The contents of address F957 will always be 03 because this portion of the address space (see Figure 1.1.1) is the monitor program and it is in ROM. ROM contains permanent data and cannot be altered. To verify this, try to change the data at this location by entering data through the keypad. For example type key 5. The resulting display should be:

Address FieldKey Data FieldRead Data Field
F9570503

Note that the key data field is a 05. This data should have been written into the address specified by the address field. However, the read data field remained a 03 which meant that this location did not take the keypad data. Had this location taken the data, then the read data field would display a 05 instead of a 03.

Example 2

Using the previous example the G0 key function can be examined. With the address and data field given:

Address FieldKey Data FieldRead Data Field
F9570303
  1. Type G0
    Address FieldKey Data FieldRead Data Field
    F9587C7C
    The address was incremented by 1 and the data of this address is displayed.
  2. If G0 is typed four more times, the resultant address and data fields should be:
    Address FieldKey Data FieldRead Data Field
    F9598181
    F95A1313
    F95BFEFE
    F95C8181

To exmine the contiguous addresses bel ow a selected address, all that is required is to type the M key.

Example 3

Using the address and data of example 1, the display will yield the following results when the M key is typed.
Address FieldKey Data FieldRead Data Field
F9562424
Hence each time the M key is typed the address will decrement by 1 and the data of the new address will be displayed. Typing the M key four more times will yield the following results:
Address FieldKey Data FieldRead Data Field
F9551414
F9548181
F9536767
F9521414

Example 4

This example will show how to examine and enter data in the user RAM; for this example lets examine the contents of location $0008.

  1. Return to monitor by typing EX.
    Address FieldKey Data FieldRead Data Field
    =       
  2. Type in address 8.
    Address FieldKey Data FieldRead Data Field
    0008    
  3. To examine this address, type M.
    Address FieldKey Data FieldRead Data Field
    0008????

    The two data fields have question marks. The question marks are there, because unless previous data was stored into this address location, the data contents will be unknown. This unknown data state is a result of the storage elements in the RAM, (see Figure 1.1.1) having random data storage on power up.

  4. To store data (for this example use $8F), first type 8.
    Address FieldKey Data FieldRead Data Field
    00080808
  5. Next type F.
    Address FieldKey Data FieldRead Data Field
    00088F8F

    Memory location $0008 will now contain the data $8F. This data will remain there, until it is purposely changed or power is turned off.

Example 5

The following example program is suitable for gaining familiarity with the D3BUG monitor features. The program adds the five values in locations $10 through $14 using Accum. A and stores the final results in location $15. The intermediate total is kept in Accum. A. Accum. B is used as a counter to count down the loop. The Index Register contains a "pointer" (i.e., X contains the address) of the next location to be added. The program, as follows, contains an error which will be used later to illustrate some of D3BUG's features.

In the following listing, the leftmost column contains the memory address where a byte (8 bits) of the program will be stored. The next column contains the machine language op-code and data for a particular microprocessor instruction. The next columns contain the mnemonic representation of the program in assembler format.

          *
          * Add 5 numbers at locations $10-$14
          * Put answer' in location $15.
          *
0020    8E      STRT    LDS   #$FF    Define stack in user area.
0021    00
0022    FF
0023    4F              CLRA          Total = 0
0024    C6              LDAB  #4      Initialze counter
0025    04
0026    CE              LDX   #10     Point X to location 10
0027    00
0028    10
0029    Ab      LOOP    ADDA  0,X     Add 1 location to total
002A    00
002b    08              INX           Point X to next location
002c    5A              DECB          Done all 5 locations?
002d    26              BNE   LOOP    Branch if not equal
002E    FA
002F    97              STAA  $15     Save Answer
0030    15
0031    7E              JMP   PROMPT  Go to D3BUG Prompt
0032    F8
0033    57

A detailed procedure for entering and debuggining this program in shown in the following steps.

  1. Start Up and Enter the Program in RAM
    1. Turn power on. Type the RS button. D3BUG will respong with a (=).
    2. Type $0020 followed by the M key. This displays the current contents of location $0020.
    3. Type 8E. This replaces the contents of $0020 with 8E which is the op­code for the first instruction.
    4. Type G0. This steps to the next location ($0021) and displays the contents.
    5. Type 00.
    6. Type G0.
    7. Type next byte of op-code or operand (FF in this case).
    8. Repeat steps F and G for remaining instructions.
    9. Type EX. Abort input function.
  2. Verify that the program was entered correctly.
    1. Type 0020M. Location $20 will be displayed.
    2. Type G0. Next location will be displayed.
    3. Repeat step B until done, visually verifying data entered in Step 1.
    4. Type EX.
  3. Enter data in locations $10 - $14.
    1. Same as 1, except type 0010M to start the sequence. Any data may be entered; however, for purposes pf this example 01, 02, 03, 04, and 05 should be entered.
    2. Type EX.
  4. Verify Data.
    1. Repeat step 2 except type 0010M to begin the sequence. Verify that the memory contains the values 01, 02, 03, 04, 05 in sequential order.
  5. Run the Program.
    1. Type EX to insure no other option is active.
    2. Type 0020GO. The program will run down to the "JUMP" instruction at location $31 which will cause it to go to D3BUG and show (=) on the display.
  6. Check the Answer.
    1. Type 0015M. (The answer is stored in location $15). Note that it says $0A (decimal 10). The correct answer is $0F or decimal 15; therefore, there is a problem in the program as originally defined. The next steps should help isolate the problem and correct it.
  7. Breakpoint and Register Display
    1. It might be helpful to see what the program was doing each time it went through the loop. Therefore, set a breakpoint at the beginning of the loop, location $0029. To do this type EX, FS, and T/B. Next type the address 0029 and then FS.
    2. A breakpoint could also be set at location $002F. To do this type 2F and then FS.
    3. D3BUG must be to1d where to begin, so type EX and then 0020GO. The program will run to the breakpoint and then display 0029 Ab. At this point the program is suspended just before location 29 and is in D3BUG. On detecting this breakpoint, D3BUG automatically displays the PC and is in the register display mode.
    4. Type RD (go to next register). The display should read 0010. This is the value of the X Register.
    5. Type RD-Display = 00 (A Register)
    6. Type RD-Display = 04 (B Register)
    7. Type RD-Display = F0 (Condition Code Register)
    8. Type RD-Display = 00FF (Stack pointer)
    9. Type RD-Display = 0029 PC. The register display is circular and steps D through H could be repeated
    10. Type RD-Display = 00 (A Register)
    11. Type GO (Proceed). Display will show 0029 Ab PC. Once again the registers may be examined.
    12. Type G0 (Proceed). Same comment as J.
    13. Type G0 (Proceed). Same comment as J.
    14. Type G0 (Proceed). Display will now type 002F 97 PC. The program has now successfully completed the loop four times and the A accumulator contain the incorrect sum.
  8. Correcting the Program.
    1. From above it is evident that although the program was supposed to add five numbers, the loop was executed only four times. Therefore, the LDAB #4 instruction at location $24 and $25 should have initialized B to five. There are two approaches to fix the problem one is temporary, the other is permanent. First the temporary one:
    2. Type EX.
    3. Type FS, T/B, then type FC twice and this will clear existing breakpoints.
    4. Type 0026FS. Set a breakpoint just after B register is loaded.
    5. Type EX.
    6. Type 0020GO. The program will execute up until $0026 and then go to the breakpoint routine and, display '0026 CE PC'.
    7. Type RD three times. This displays the current vaiue in the B accumulator (04 Ab).
    8. Type 05. The display will change to 05 Ab.
    9. Type GO. Program should execute and return to prompt (=).
    10. Type 0015M. Display = 0015 0F. The program has now calculated the correct value for the addition of the five numbers This verifies the fix but would be inconvenient to do each time the program was executed. A permanent change would be:
    11. Type EX, FS, and T/B. Then type FC once and this clears existing breakpoints.
    12. Type EX.
    13. Type 0025M. The display = 0025 04.
    14. Type 05. The display = 0025 05. This will now permanently change the LDAB #4 instruction to a LDAB #5 instruction.
    15. Type EX.
    16. Type 0020G0. Execute the program.
    17. Type EX.
    18. Type 0015M. Display = 0015 0F, the expected answer; the program is permanently fixed.
  9. Trace Through the Program.
    1. Type EX. To trace from the beginning:
    2. Type FS and T/B. Then type FC as many times as required to remove breakpoints.
    3. Type FS and T/B. Next type $020 and then FS. This sets a breakpoint at the first instruction.
    4. Type EX.
    5. Type 0020GO (Go to user program). D3BUG will immediately get the breakpoint and type 0020 8E.
    6. Type T/B. The program will execute one instruction and display 0023 4F. At this point the user can either display the registers by typing RD or continue. To continue:
    7. Type T/B. G0 to next instruction. Display register if desired.
    8. Continue step G for as long as desired.
    9. Type EX. Clear trace mode.