Kjetil's Information Center: A Blog About My Projects

Motorola BDM Debugger in DOS QEMU

I have some boards with a Motorola 68332 MCU (which later became Freescale and then NXP) that have a Motorola 68000 core. There is a debugging port on these boards known as "BDM" or "Background Debug Mode" which is very useful.

I have managed to connect to this port using an adapter that can be connected to a standard PC parallel port. There seems to be two versions of this adapter found on the Internet, one using a 74LS74 flip-flop and another using a 74LS76 flip-flop.

I built the 74LS74 variant using a prototype circuit board. To help with this I converted the schematic to another form to show where to connect all the wires using color coding:

BDM Board Schematic


Here is a picture of the finished adapter without the logic chips. 14-pin DIP sockets should have been used but I only had 20-pin DIP sockets available:

BDM Board


Here are the signals on the pin header that can be connected to a parallel port on a PC:

|-------|------------|--------|
| DB-25 | Signal     | Header |
|-------|------------|--------|
| 17    | STEP_OUT   | A      |
| 10    | PWR_DN/VCC | B      |
| 14    | RSTOUT     | C      |
|  1    | DSCLK      | D      |
| 15    | FREEZE     | E      |
| 12    | DSO        | F      |
| 16    | DSI        | H      |
| 11+18 | NC/GND     | I      |
|-------|------------|--------|
          


Here are the signals going to the target BDM port:

|---------|--------|
| Signal  | Header |
|---------|--------|
| DSCLK   |  4     |
| VSS/GND |  5     |
| FREEZE  |  6     |
| RESET   |  7     |
| DSI     |  8     |
| VDD/VCC |  9     |
| DSO     | 10     |
|---------|--------|
          


I have put MS-DOS 6.22 on a QEMU x86 emulator image and then installed the DOS-based "BD32" program from Motorola which can still be found on NXP's pages.

The modern PC I am using has a PCI-express board with a parallel port and enabling passthrough in the QEMU emulator on Linux done by simply passing this on the command line arguments:

-parallel /dev/parport0
          


It is important to "slow down" the communication speed in BD32 when running on faster hardware, so I have used the setting "1000" which can be configured in the "bd32.cfg" file like so:

lpt1
1000
          


Here is a screenshot of QEMU running BD32 in DOS:

BD32 in QEMU


Topic: Configuration, by Kjetil @ 06/01-2023, Article Link