Author Topic: How to read flash from Motorola/NXP mcu  (Read 6164 times)

0 Members and 1 Guest are viewing this topic.

Offline frenkyTopic starter

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
How to read flash from Motorola/NXP mcu
« on: September 06, 2016, 08:00:09 am »
Guys I really need your help.

I really like to fix stuff for friends but this one turned from joy to nightmare really quick.

A "friend of a friend" brought me a control panel that regulates two dc motors of some kind of industrial machine...
While investigating the circuit I accidental connected 24v and 5v lines.  :palm:

There are two mcu's on the board and before accident leds near mcus were blinking. Now they are not.



I have a bunch of different ic programmers at home so my question is:

Is there a way to dump flash with code to pc and put in onto a new mcu? (if mcu is still able to access memory)

Mcu markings:  MC908 KX2CDWE 2L09H
Data sheet: http://pdf.datasheetz.com/data/Integrated%20Circuits%20(ICs)/Microcontrollers/MC68HC908KX2CP-datasheetz.pdf

Whole board:




« Last Edit: September 06, 2016, 10:31:53 am by frenky »
 

Offline johm

  • Contributor
  • Posts: 39
  • Country: es
  • Really fond of Sines & Silicon.
Re: How to read flash from Motorola/NXP mcu
« Reply #1 on: September 06, 2016, 10:41:12 am »
In case you need a programmer and budget is not a problem:
https://elmicro.com/files/softecmicro/indart-one_manual.pdf
http://www.newark.com/softec-microsystems/indart-one/programmer-debugger-for-hc08-hcs08/dp/85K2275

Otherwise you can try this evaluation board:
http://www.ebay.com/itm/Beta-Control-HC908KX8-Evaluation-Kit-fur-MC68HC908KX8CP-/221642004290?hash=item339ae49742:g:q2AAAOxyaURTe0wt

Or this (your MC68HC908KX8CP is not explicitly specified):
https://de.aliexpress.com/item/Free-shipping-MON08-programmer-MC908-68HC08-microcontroller-simulation-read-and-write-Download/32402621593.html

Seeing the whole board though, this DB9 connector seems to program those MC908 chips. This way, you could place the DIP switches in programming position and use the computer to bit bang its protocol as specified in the PDF document above. I haven't been able to find a free programming software for the KX family except for a demo version of Freescale's CodeWarrior, which includes programming utilities:

http://www.nxp.com/products/software-and-tools/software-development-tools/codewarrior-development-tools/codewarrior-development-suites/codewarrior-development-suite-basic:CW-SUITE-BASIC

I'd like to be more helpful but that was all I could find; AZ series are far more popular than KX, it seems.
Assembly is the high level programming for an ASIC design engineer (with no VHDL/Verilog).
 
The following users thanked this post: frenky

Offline frenkyTopic starter

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: How to read flash from Motorola/NXP mcu
« Reply #2 on: September 06, 2016, 11:53:51 am »
Thank you. You have been very helpful. Sadly budget is non existent...

I have been searching an reading a lot too..

I have found this diy programmer:
https://sourceforge.net/projects/hc08prog/

and this one:
http://www.physics.mcmaster.ca/tech/HC908/HC908Intro.htm#programming

and this one:
http://www.sparetimelabs.com/funwith08/funwith08.php

I have also bought pci-2-serial card to try to connect to the serial port on the board.

 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: How to read flash from Motorola/NXP mcu
« Reply #3 on: September 06, 2016, 02:19:56 pm »
If the chiop is dead you're going to find it rather difficult  to read anything from it.

Have you checked the obvious things first?

Do the chips have power, is that clock oscillator running, do the chips have an external reset line and does it do what you expect it to?

While I'm inclined to agree that you've screwed the board up royally, it still makes sense to check the basics and not jump to the most complex solution first.
 
The following users thanked this post: frenky

Offline frenkyTopic starter

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: How to read flash from Motorola/NXP mcu
« Reply #4 on: September 06, 2016, 06:30:51 pm »
I measured voltages and were fine but didn't check out the oscillator. :P

I've checked it now with a scope and there was nothing on the output.
I desoldered it just to be sure that nothing is pulling it down and result is the same.  :-+

So there still is some hope that mcus did not fry...

The oscillator is Epson 9.8304Mhz 5V.

Just for test... would it be ok to replace it with 8MHz which I can get localy? Just to see if leds start to blink again.
My brains say that lower frequency should be safe but I'd rather ask and look stupid than screw up something again...
« Last Edit: September 06, 2016, 06:51:36 pm by frenky »
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: How to read flash from Motorola/NXP mcu
« Reply #5 on: September 06, 2016, 07:21:24 pm »
Should be fine with a lower frequency but you may find it won't communicate properly with whatever controls it.

I still think the board is probably fried but it won't harm to try another oscillator.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8270
Re: How to read flash from Motorola/NXP mcu
« Reply #6 on: September 07, 2016, 10:17:16 am »
The flash could be read-protected... this MCU is programmed/accessed via an internal ROM which communicates over serial - see chapter 16 of the datasheet. If you can read the ROM you may be able to disassemble it and find the undocumented way in which it locks/unlocks the flash, or power-glitch it to bypass the protection.
 
The following users thanked this post: frenky


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf