Author Topic: Replacing Obsolete micro?  (Read 4394 times)

0 Members and 1 Guest are viewing this topic.

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Replacing Obsolete micro?
« on: July 19, 2020, 04:51:17 pm »
I have an interesting project.

I have a PCB that uses an old MCHC705B16NCFNE micro, which is obsolete.
Data link here: https://www.nxp.com/docs/en/data-sheet/MC68HC05B6.pdf

I have access to the PCB build files, but not the original files for compiling the micro's program, so all I could do is copy the program directly. I was able to find a small supply of "NOS" from an Asian source, but so far only about 25% of the micro's I've ordered actually function. The customer would like between 100 and 200 finished PCBs if this is possible, and neither he nor I are happy about using likely counterfeit/faulty micros, and would like something new from a reputable parts house.

I've never attempted such a thing before, but is anybody aware of a micro that is still in active status that could accept the copied program? Package difference is no problem, as I can re-configure the PCB to accept whatever.

Thoughts?
 

Offline greenpossum

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: au
Re: Replacing Obsolete micro?
« Reply #1 on: July 19, 2020, 05:11:48 pm »
Just out of curiosity I looked up this micro, which I have seen but never used. The wiki page claims that the HC08 is code compatible with the HC05 but I have no idea if that means assembly code compatible or binary code compatible. Maybe this can be a starting point for further searching?

https://en.wikipedia.org/wiki/Motorola_68HC08
 

Online Andreas

  • Super Contributor
  • ***
  • Posts: 3363
  • Country: de
Re: Replacing Obsolete micro?
« Reply #2 on: July 19, 2020, 07:51:59 pm »
Usually Rochester is a serious source:
https://www.rocelec.com/search?q=705B16

Sometimes they also re-built devices with the orignal masks from the previous supplier.

with best regards

Andreas

 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6618
  • Country: nl
Re: Replacing Obsolete micro?
« Reply #3 on: July 19, 2020, 08:19:19 pm »
How large is the source code?
If <4kB you could Reverse engineer the disassembly code or reverse engineer the functionality with logic probes.
You have to do that anyway unless you find a 1:1 mapped compatible cpu.
I did this in the late 80s with a 8048 eprom of 2kB.
Within two weeks you can get this done and you can write new code in C on any uC you like.
Even if you find a code compatible cpu you still have to retest each and every functionality.
Without the code, how do you know you tested everything ?
 
The following users thanked this post: Ian.M

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #4 on: July 19, 2020, 09:33:00 pm »
How large is the source code?
If <4kB you could Reverse engineer the disassembly code or reverse engineer the functionality with logic probes.
You have to do that anyway unless you find a 1:1 mapped compatible cpu.
I did this in the late 80s with a 8048 eprom of 2kB.
Within two weeks you can get this done and you can write new code in C on any uC you like.
Even if you find a code compatible cpu you still have to retest each and every functionality.
Without the code, how do you know you tested everything ?

The idea (hopefully) was find a compatable micro, clone the code over, make an adapter PCB (for testing purposes), solder it on and see if it functions  ;D

Reverse engineering the functionality is more likely, TBH. I may have to get with someone who far more software savvy than me and see if we can do something. It would be less than ideal, but maybe the last resort?
 

Online up8051

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: pl
Re: Replacing Obsolete micro?
« Reply #5 on: July 19, 2020, 09:45:15 pm »
First check how many pins are used and what functions they have.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Replacing Obsolete micro?
« Reply #6 on: July 19, 2020, 09:53:00 pm »
A more extreme approach would be to emulate the original microcontroller on a more capable device.

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5068
  • Country: nz
Re: Replacing Obsolete micro?
« Reply #7 on: July 19, 2020, 10:48:19 pm »
A more extreme approach would be to emulate the original microcontroller on a more capable device.

That's probably the smallest amount of work, to be honest.

I haven't checked how close it is to vanilla 6800, but I can write a cycle-accurate purely interpretive emulator for that class of CPU core in a couple of days if I have a significantly faster CPU to run it on. If it's running at 1-2 MHz with multiple clock cycles per instruction you might just about be able to emulate it with a 16 or 20 MHz AVR (it might be a challenge). With a 48 MHz or something ARM it would be cake.

Mapping the timers and I/O would be more work. You'd have to figure that out if you went the hand-disassembly-to-C route anyway.

I'm free at the moment and enjoy doing this kind of perverse thing so HMU if you're interested (on a commercial basis).
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5068
  • Country: nz
Re: Replacing Obsolete micro?
« Reply #8 on: July 19, 2020, 11:00:31 pm »
There's a 6805 emulator here https://github.com/forthnutter/6805

Written in some kind of wacky FORTH that runs on the Java VM, so probably not useful except maybe as a reference. Seems to be BSD license.
 

Offline JXL

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: Replacing Obsolete micro?
« Reply #9 on: July 19, 2020, 11:12:18 pm »
 
The following users thanked this post: edavid

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5068
  • Country: nz
Re: Replacing Obsolete micro?
« Reply #10 on: July 19, 2020, 11:12:58 pm »
The MAME project has a 6805 emulator at https://github.com/mamedev/mame/tree/master/src/devices/cpu/m6805

That might be more useful. GPL license.
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #11 on: July 19, 2020, 11:26:16 pm »
These guys may be able to supply your needs:
https://www.tekmos.com/products/microprocessors/68hc705-microcontrollers

OOOOOOOOHHHHHHHHH

I will call on Monday!
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #12 on: July 20, 2020, 05:14:43 pm »
Got a reply back from Tekmos.

They have a MOQ of 100 units $30/unit. Just an FYI for anybody else interested in this particular micro.

Since I no longer have access to the source code, and can only read the micro with a programmer, that limits programming.

Tekmos specified they need the program in HEX of S19 format.

Usually, I'm just straight cloning memory ICs and run PCB layout and population, programming is out of my area of expertise. Any idea if from just reading the OEM micro I can get the program to Tekmos in the format they require?
 

Offline Jay1011

  • Contributor
  • Posts: 32
  • Country: us
Re: Replacing Obsolete micro?
« Reply #13 on: July 20, 2020, 06:48:19 pm »
Perhaps try also: https://octopart.com/search?q=mc68hc705b16&currency=USD&specs=0&in_stock_only=1

The results show several distributors with stock, including "GreenTree Electronics" with >22K in stock.  I have no idea if that's true or if GreeTree is a reputable company, but might be worth a check.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6618
  • Country: nl
Re: Replacing Obsolete micro?
« Reply #14 on: July 20, 2020, 08:27:07 pm »
Got a reply back from Tekmos.

They have a MOQ of 100 units $30/unit. Just an FYI for anybody else interested in this particular micro.

What is the definition of unit ? Not 1 piece I hope ?  :o
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5068
  • Country: nz
Re: Replacing Obsolete micro?
« Reply #15 on: July 20, 2020, 10:44:35 pm »
Got a reply back from Tekmos.

They have a MOQ of 100 units $30/unit. Just an FYI for anybody else interested in this particular micro.

Interesting. What's the lead time?

For a small and simple chip like a 6805, that price would give a very healthy margin over the cost of making a batch (usually 100) on a shuttle run aka MPW (Multi Project Wafer).
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #16 on: July 20, 2020, 11:10:01 pm »
Got a reply back from Tekmos.

They have a MOQ of 100 units $30/unit. Just an FYI for anybody else interested in this particular micro.

What is the definition of unit ? Not 1 piece I hope ?  :o

Yes, $30 per piece.
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #17 on: July 20, 2020, 11:10:41 pm »
Got a reply back from Tekmos.

They have a MOQ of 100 units $30/unit. Just an FYI for anybody else interested in this particular micro.

Interesting. What's the lead time?

For a small and simple chip like a 6805, that price would give a very healthy margin over the cost of making a batch (usually 100) on a shuttle run aka MPW (Multi Project Wafer).

I did not get a lead time, but their website mentioned the 100 MOQ for in-stock items, 3k for new runs.
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1143
  • Country: nz
  • Retired Electronics Design Engineer
Re: Replacing Obsolete micro?
« Reply #18 on: July 20, 2020, 11:33:50 pm »
If you can read from the micro as a binary file it should be pretty straight-forward to convert to an S19 file. Any decent EPROM programmer should be able to save the binary file to an S19 format. Failing that you could write a program on your PC to convert a binary file to S19 format - it is a very simple format to convert.

You might to consider converting to a more recent Freescale processor like the RS08 family. This will be largely compatible at an assembly language level but probably not at a binary level. To get the assembly language source code from your existing program you will need to disassemble the binary but this shouldn't be too hard - the 6805 series has a very simple processor architecture.

If you are changing processors one of the most important factors will be to get a processor that has a similar peripheral set to the original. You are more likely to get this match if you stick with something from the Freescale repertoire as most of their 8-bit processors share a similar peripheral set.

As a lot of the code in a typical low-end embedded application is I/O intensive so changing to another processor family could involve considerable rewriting of code to drive the new peripherals to obtain the necessary I/O functions.
« Last Edit: July 20, 2020, 11:36:57 pm by srb1954 »
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5068
  • Country: nz
Re: Replacing Obsolete micro?
« Reply #19 on: July 20, 2020, 11:44:10 pm »
Got a reply back from Tekmos.

They have a MOQ of 100 units $30/unit. Just an FYI for anybody else interested in this particular micro.

Interesting. What's the lead time?

For a small and simple chip like a 6805, that price would give a very healthy margin over the cost of making a batch (usually 100) on a shuttle run aka MPW (Multi Project Wafer).

I did not get a lead time, but their website mentioned the 100 MOQ for in-stock items, 3k for new runs.

That's pretty exorbitant, but if you only want 200 boards then you're probably best off to just suck up that $6k, especially given you don't have to redesign the board.

I hope they charge a lot less for the 3000 chip runs. For $90k you could get someone to emulate it in a $10 FPGA or a $1 or $2 ARM. I don't know if you could get the same package -- it looks like it's also obsolete.
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #20 on: July 21, 2020, 10:51:23 pm »
Got a reply back from Tekmos.

They have a MOQ of 100 units $30/unit. Just an FYI for anybody else interested in this particular micro.

Interesting. What's the lead time?

For a small and simple chip like a 6805, that price would give a very healthy margin over the cost of making a batch (usually 100) on a shuttle run aka MPW (Multi Project Wafer).

I did not get a lead time, but their website mentioned the 100 MOQ for in-stock items, 3k for new runs.

That's pretty exorbitant, but if you only want 200 boards then you're probably best off to just suck up that $6k, especially given you don't have to redesign the board.

I hope they charge a lot less for the 3000 chip runs. For $90k you could get someone to emulate it in a $10 FPGA or a $1 or $2 ARM. I don't know if you could get the same package -- it looks like it's also obsolete.

Yup, spendy, but we we are still discussing options. These are control boards for some old industrial equipment that is still popular/in use, so it is may be better money (and a biz opportunity) to make some PCB re-designs and updates, and run on an emulator and make a couple thousand boards.

The emulating one micro on another micro is something new for me, that will take some investigation, but we would likely job that out. Any idea what we may expect to pay for someone to make that work?
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Replacing Obsolete micro?
« Reply #21 on: July 22, 2020, 06:24:05 am »
If you haven't already, also try to estimate the cost of reimplementing the software from scratch.

Offline Wiljan

  • Regular Contributor
  • *
  • Posts: 230
  • Country: dk
Re: Replacing Obsolete micro?
« Reply #22 on: July 22, 2020, 11:08:32 am »
Maybe you could use a MC68HC05 clone for a FPGA with the bin dump file https://opencores.org/projects/68hc05
 

Online up8051

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: pl
Re: Replacing Obsolete micro?
« Reply #23 on: July 22, 2020, 11:22:55 am »
Do you have access to the code binary/hex file?
Microcontroller can be protected to readout.
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #24 on: July 22, 2020, 02:38:35 pm »
Do you have access to the code binary/hex file?
Microcontroller can be protected to readout.

Yes, we can pull the the program from the micro.
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #25 on: July 22, 2020, 06:07:35 pm »
Maybe you could use a MC68HC05 clone for a FPGA with the bin dump file https://opencores.org/projects/68hc05

@Wiljan

I'm not a software guy, so could you (or anybody) elaborate on this? Is it the same as an emulator?
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5068
  • Country: nz
Re: Replacing Obsolete micro?
« Reply #26 on: July 22, 2020, 09:11:48 pm »
Maybe you could use a MC68HC05 clone for a FPGA with the bin dump file https://opencores.org/projects/68hc05

@Wiljan

I'm not a software guy, so could you (or anybody) elaborate on this? Is it the same as an emulator?

An FPGA is hardware. You design a hardware logic circuit that does what the original microcontroller does. It's I suppose more of a clone than an emulator. The circuit won't be exactly the same as the original, but maybe somewhere close. You could implement your circuit in 7400 MSI, you could put it in a custom chip. Or you can put it in an FPGA. FPGAs have large numbers of logic gates, flip-flops, SRAM, ALUs. You wire them up according to your design. It's fairly easy to get a modern FPGA to run a CPU at around 50 MHz to 100 MHz, which is a lot faster than ancient micros.
 

Offline Wiljan

  • Regular Contributor
  • *
  • Posts: 230
  • Country: dk
Re: Replacing Obsolete micro?
« Reply #27 on: July 22, 2020, 09:57:12 pm »
Running a soft core CPU in a FPGA means you program the FPGA to have the same logic chip as a CPU does have internally and also the ROM so it can run the program.
Then you have to route the intentional connection to physical pins on the FPGA and have the right voltage levels / clk etc and then the FPGA will do the same as the CPU . It's typical what some people do when the run like "Pacman"  :rant: :rant: :rant: from a Z80 CPU but now in a FPGA https://www.fpgaarcade.com/kb/pacman/

Softcores form many different CPU's are available https://en.wikipedia.org/wiki/Soft_microprocessor
https://opencores.org/projects?expanded=Processor

It might be a solution for you but sure the PFGA will need quite some learning for you if you never used it before

I see the link I gave you for the 68H05 have only VHDL code and have as good as no doc

If you look on the T48 there are much more documentation  sure for a total different processor but the idea is exactly the same
https://opencores.org/projects/t48
https://opencores.org/websvn/filedetails?repname=t48&path=%2Ft48%2Ftrunk%2Fdoc%2FT48+Integration+Manual.pdf

Hope it makes a little sense  :)
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #28 on: July 22, 2020, 10:15:35 pm »
Let me see if I understand this properly:

I could take a shelf FPGA, "program" it for the pinout of the obsolete 68 (I understand different footprint, no big deal as I can re-design the PCB to accomodate), and then I can upload the binary/hex to the FPGA and it would act as the obsolete 68?

Surely it is more difficult than it sounds?
 

Online up8051

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: pl
Re: Replacing Obsolete micro?
« Reply #29 on: July 22, 2020, 10:33:24 pm »
It's more difficult because of peripherals (timers, serial interfaces, PWM) and special  ADC.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6618
  • Country: nl
Re: Replacing Obsolete micro?
« Reply #30 on: July 23, 2020, 08:11:34 am »
If you are really talking about thousand(s) of boards and product continuation for coming ten years this would IMO be the right time to invest in a new uC and re-design.
What the company did wrong and should now improve on is not using a third party or make good agreements with the 3rd party company such that:
1 there is good documentation , architecture, UML diagrams flowcharts and source code
2 that they own the source code and the software is written in a universal language preferably C or C++
3 aftercare, bugfixes, new features etc.

Do not use a single individual or 1-2 man startup or small company unless you know they have an excellent trackrecord and are well known.
Hire a larger company that has multiple embedded software and hardware people in their services. Here in the vicinity of Eindhoven there are at least 5 of those companies I would entrust it to, so this is not difficult. Make it a fixed price inhouse (their house not your company) project and they have experienced engineers helping new hires and existing people that have no current work on it and thecequipment.

This might be more expensive at first but essential to guarantee point 3 and have a better guarantee that the project will be completed (had my share of experiences with 1 man companies that went belly up or could not deliver in the end what was promised, quality of the software can also be terrible).
« Last Edit: July 23, 2020, 08:14:05 am by Kjelt »
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2513
  • Country: gb
Re: Replacing Obsolete micro?
« Reply #31 on: July 23, 2020, 08:21:08 am »
I have access to the PCB build files, but not the original files for compiling the micro's program, so all I could do is copy the program directly.
Why do you not have access to the originals?  Is this a RE exercise?
It's difficult to suggest an approach without knowing the scale of your problem and the margins?  If it is large then it's a redesign, if it is medium then a port to another similar but available device and if it is small then a hunt for old/compatible parts.
I am suspicious if the only thing is the thing itself... suggests lack of knowledge of function and hence limits the ability to test/verify the next version.
 

Offline Rat_PatrolTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: us
Re: Replacing Obsolete micro?
« Reply #32 on: July 23, 2020, 02:50:30 pm »
I have access to the PCB build files, but not the original files for compiling the micro's program, so all I could do is copy the program directly.
Why do you not have access to the originals?  Is this a RE exercise?
It's difficult to suggest an approach without knowing the scale of your problem and the margins?  If it is large then it's a redesign, if it is medium then a port to another similar but available device and if it is small then a hunt for old/compatible parts.
I am suspicious if the only thing is the thing itself... suggests lack of knowledge of function and hence limits the ability to test/verify the next version.

When the original PCB was ordered, and the company that had the manufacturing contract used a third party to write the software, which is OOB. Apparently, they either didn't get the source files or have lost them. This equipment is 25 years old... Anyway, all I have is the schematic for the PCB itself.

Despite the age, industrial equipment can be kept in service quite a while, and while my customer *needs* about 20 boards, he would like a lifetime supply for himself (for the 100 or boards), and since this equipment is still out there, running up 1-2k and then selling them over probably 5 years could make money on my end.

Perhaps writing all new software would be appropriate, and it probably is, but I'm not sure the juice is worth the squeeze, especially if we can avoid it. The fun part would be figuring out all the communication protocols for all the various conditions. This micro is apparently monitoring various parameters for fault conditions, along with some type of diagnostic tool communications. Yeah, there is external memory involved.

So it is at least partly a RE job, yes.

The simplest approach would just be clone the program onto another micro. The program works fine, the hardware is just aging and failing.
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2513
  • Country: gb
Re: Replacing Obsolete micro?
« Reply #33 on: July 24, 2020, 08:16:01 am »
To be honest the next step is going to involve detail so that would require a schematic.

Although 68HC05 is obsolete there are devices like MC908GZ16MFAE which might be of interest.  I believe your device is really just a 6800 with a few peripherals (sorry I haven't used that one)... 68HC05 was superceeded by 68HC08?

It's all do-able... just depends on how many hours and $ you want to spend!
 

Online up8051

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: pl
Re: Replacing Obsolete micro?
« Reply #34 on: July 24, 2020, 04:25:59 pm »
Try to disassemble code.
If source code was written in assembler then disassembly result should be clean and easy to interpret
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf