|
You may download a compression of the files needed here. A copy of this guide is available in document format here. A full folder of files, including this guide in "doc" file,can be downloaded here. Compressed files are compressed with Winrar.
This guide is to show the various methods of restoring D-Bug12 onto the HC12 evaluation board.
NOTE: At the time of this document, I did not know of a way to use the USB BDM to flash the D-Bug12. If you have figured out a way to do this, feel free to write down the process and see Dan about incorporating it into this document.
Requirements
A BDM (secondary microcontroller or standalone BDM)
A serial connection (on computer or via USB to Serial adapter)
An IDE for flashing the file to the microcontroller (such as AxIDE)
The D-Bug12 and bootloader s19 files
6-pin ribbon cable
Before you begin familiarize yourself with some key areas:
Voltage regulater, phone jack, and power connector:

BDMin and BDMout pins:
These are located between the phone jack and the power supply connector. Pin 1 is on the left. All red stripes on ribbons must be on the pin1 side.

EVB and POD mode jumpers/switch:
These are located right above the 7 segment LED.
(Old boards)
The EVB mode is the regular mode where you use D-Bug12. POD mode is to use the HC12 as a BDM. The top jumper shown in the picture below is used to select the mode. Set the jumper accord to the mode you need.

(New Boards)

Setting Up a Target and POD HC12 Instructions
- A target HC12 is the HC12 you wish to flash the D-Bug12 to.
- To flash a HC12, you need a BDM or a secondary HC12 in POD mode to act as DBM.
- If you have a regular DragonBDM simply connect the phone wire into the BDM and the ribbon cable from the BDM to the “BDMin” pins on the target HC12.
- Make sure the red stripe on the ribbon cable is on the pin1 side.

- If you don’t have a BDM then you will need a second HC12 that had the D-Bug12 on it.
- Set the second HC12 to POD mode.
- Connect ribbon cable to the BDMout of the POD HC12.
- Connect the other end of the ribbon cable to the BDMin of the target HC12.
- Plug the phone wire into the POD HC12.
- Power the POD HC12 or both HC12s.

- You are now ready to move on to the next section.
Flashing Program Instructions
- If you see an “R>” after powering the HC12, this means the target HC12 is in control.

- Use “reset” command or reset the POD mode HC12 manually to proceed.
- You should now see the “S>”
- If you see “Can’t Communicate With Target CPU”:
- Press Enter if target speed is already 16000 KHz.
-

- Otherwise select “1.) Set Target Speed (4800 KHz)”.

- Type 16000 and hit Enter.

- You should now see the “S>”

- Use the “fbulk” command to erase the target flash memory.
- Type “fbulk” and hit Enter.
- Then use the “fload” command to load the bootloader file.
- Type “fload” and hit Enter.

- Click on “Load” button on the IDE.
- Click on “Browse” button and select the “MiniDRAGON_boot_16.s19” file.
- Click “Open”
- Click “Ok”
- The bootloader will now flash into memory.
- DO NOT type on your keyboard until the transfer window has disappeared. It will count to around 70.

- After the transfer window disappears, reset the POD microcontroller manually.
- At the “S>”, use “fload” command once again to load the D-Bug12 this time.
- Type “fload” and hit Enter.

- Click on “Load” button on the IDE.
- Click on “Browse” button and select the “db12DP256-16_b29.S19” file.
- Click “Open”
- Click “Ok”
- The D-Bug12 version 29 will now flash into memory.
- DO NOT type on your keyboard until the transfer window has disappeared. It will count to around 2000.
- Wait for the transfer window to disappear. (You may take a break now. The process lasts almost 2 minute.)
- After the transfer window disappears:
WARNING: If using 2 HC12s with only one power supply, the voltage regulator on the powered HC12 may become hot.
- Disconnect ribbon cable.
- Replace jumpers back to original position.
- You are now finished!
|