Shortneck SID

Shortneck SID board with the MC9S12DJ256B

The later SID in the OG 9-5, the shortneck one. It runs a Freescale MC9S12DJ256B (HCS12) in the 80-pin QFP with 256 KB banked flash (pages 0x30 to 0x3F) and 4 KB EEPROM. The earlier longneck is a different board with a mask ROM 68HC05X32.

Pins, LCD and CAN setup are on the SID Ver 12.0 page.

Reading it over the bus

The SID speaks KWP2000 on the I-bus and has a read memory service, but it only reaches what the CPU sees in its 64K window: page 0x30 and the two fixed pages 0x3E and 0x3F. The read handler runs from page 0x30 itself, so the window can't be switched to another page.

Pages 0x31 to 0x33 have code in them too, so a dump over the bus is never complete. There's no flash write code in the firmware at all either, so writing a SID is BDM only.

BDM wiring

Four wires: BKGD, RESET, GND and 5 V as reference for the adapter. The drawing has the chip turned like in the photo, text upright and the pin 1 dot bottom left. Pins 1-20 run along the bottom from left to right, then counter clockwise around the chip.

MC9S12DJ256B pin 15 BKGD, 30 RESET, 29 VDDR and 28 VSSR wired to the ArduBDM 10-pin box header, pins 4 and 6 bridged
SignalMCU pinWhere on the chipHCS12 6-pinArduBDM 10-pin
BKGD15Bottom edge, 6th from the right18
GND28 (VSSR) or 76 (VSSX)Right edge, 8th from the bottom23 or 5
RESET30Right edge, 10th from the bottom47
5 V29 (VDDR) or 77 (VDDX)Right edge, 9th from the bottom69

Before you solder, beep pins 10, 28, 50 and 76 to ground with the SID unpowered. All four are ground, so if they all beep the chip is turned the way the drawing says.

28, 29 and 30 are neighbours at 0.65 mm pitch, check for bridges. GND and 5 V can come from any easier ground or 5 V point on the board, just measure it first. Never use pin 9, 31 or 49, that's the 2.5 V core supply.

The board has conformal coating, scrape it off the legs you solder to.

Power the SID as normal. The BDM adapter only uses the 5 V as a reference, it doesn't power the SID.

ArduBDM

The ArduBDM header is the 10-pin CPU32 one, so you need an adapter cable. Bridge pin 4 to pin 6 in the plug, that turns the level shifter around for single wire BDM. The key slot on the box header is on the odd pin side facing the Nano, pin 1 is next to the triangle.

HCS12 support for ArduBDM is in the works and not released yet. Any HCS12 BDM pod works with the same four wires on the standard 6-pin header.

Dumping

Hold BKGD low through reset so the chip starts halted in special single chip mode. Then for each page 0x30 to 0x3F write the page number to PPAGE (0x0030) and read 0x8000-0xBFFF. Put them after each other and you have the full 256 KB. Pages 0x34 to 0x3D are empty in the dumps I have.

The security byte at 0xFF0F is 0xFE in my dumps, so the flash is unsecured and BDM reads just work.

Gotcha: while the chip is in active BDM the BDM ROM shows up at 0xFF00-0xFFFF, so the vectors at the end of page 0x3F come out wrong if your tool reads them through firmware commands. Read that range with the hardware READ_WORD command.