Simple Programmer for vintage Intel MCS-48 Microcontroller - Page 1
Forum section: electronics / general

author: SaabFAN
author_rank: Frequent Contributor
timestamp: July 03, 2016, 10:33:20 pm
content: Because my PM6654C counter stopped working just about a week after I installed a self-made OCXO-Module, I spent basically the whole saturday trying to pin down the problem, which led me to believe that the Intel 8741 processor is the cause (see my thread in the repair-forum for more details).A bad 8741 is rather problematic, because I only have a TL866-Programmer here, which cannot program the MCS-48/UPI-41 Microcontroller-Series. Aside from really expensive programmers, only the Willem Programmer with the LPT-Connector seems to be compatible, but investing 50+ Euros for a programmer that would arrive in about 4 weeks was out of the question. The same obviously goes for the expensive ones.So I decided to make my own.The MCS-48 Microcontroller-Series is controlled by first latching the Address into the processor, then applying the data, providing 21V to VDD and then pulsing the PROG-Pin with +18V for 50ms. Repeat that 1024 or 2048 times and the program is transferred to the internal memory.For the controller I chose to use one of the many Arduino Nanos I bought some time ago on ebay for 3€ a piece.To make the Power-Supply simpler, the required input-voltage is 21,5V and the +18,5V and +6V (Supply-Voltages slightly higher to account for Vdrop in the Diodes) are provided by LM317s.BC327 PNP Transistors are used to toggle between 5V and the higher voltages, pins that require +5V max are directly connected to the Arduino Nano.Because I was extra-lazy, I wrote the Software in a way that the program that is about to be programmed into the Micro is stored inside the Arduino Sketch. To make sending the data and getting program-messages via Serial Connection possible, I wired the Nano in a way that requires some bit-shifting in the software, but keeps the Serial IN/OUT-Pins free (Pins 0 and 1 of PORT D).Care must be taken when building this thing though, because PB4 and PB3 are switched around (see Arduino Nano Pinout:https://bigdanzblog.wordpress.com/2015/01/30/cant-get-i2c-to-work-on-an-arduino-nano-pinout-diagrams/).It should also be possible to build this thing with other Arduinos and put it together on a breadboard.Btw. If you start messing around with these devices, a UV-Eraser is a must!I hope this helps other people who came across these Micros, which seem to have been quite popular in the 80s - at least with Philips engineersDatasheet for the UPI-41 - including the programming-procedure and the same for the MCS-48:http://www.intel.com/design/archives/periphrl/docs/29025601.pdf

author: Kalvin
author_rank: Super Contributor
timestamp: July 04, 2016, 12:28:37 am
content: The PNPs switching the higher programming voltages looks conducting all the time.

author: SaabFAN
author_rank: Frequent Contributor
timestamp: July 04, 2016, 12:35:27 am
content: Yes. I was hoping that with 1k or 10k resistors the current flowing through them and the ESD-Diodes of the Arduino would be low enough to have no effect (these old chips are power-hungry). If that is not the case, I probably need pull-up resistors at the bases of the transistors, or an NPN inverter-stage to control the PNPs.

author: Kalvin
author_rank: Super Contributor
timestamp: July 04, 2016, 01:09:59 am
content: Just add the three NPNs with 2k base resistors for a robust design and you will save yourself from a lots of grief.

author: bktemp
author_rank: Super Contributor
timestamp: July 04, 2016, 07:00:12 am
content: Quote from: SaabFAN on July 04, 2016, 12:35:27 amThat does not work. I/O pins can only output or float to a higher voltage than Vcc or lower voltage than GND. In both cases there is a high enough current flowing turning the transistors on.You could try adding 16V and 19V zener diodes to level shift the logic levels, but the best way is adding three NPNs as already suggested.I would also add pulldowns on EA and PROG to make the turn off slewrate a bit faster because there is not much current flowing into the pins.

author: stj
author_rank: Super Contributor
timestamp: July 04, 2016, 07:13:26 am
content: or buy a pin-compatable flash based device with ICP interface

author: SaabFAN
author_rank: Frequent Contributor
timestamp: July 04, 2016, 03:17:40 pm
content: Quote from: stj on July 04, 2016, 07:13:26 amEven if there is a pin-compatible replacement for the 8741, I would have to port the Software (which I would have to disassemble and then understand) to restore the functionality to my PM6654C counter (which is the primary reason why I'm building this). I guess that would be quite a bit harder to do.Do you know of any pin-compatible devices?

author: batteksystem
author_rank: Regular Contributor
timestamp: July 04, 2016, 04:30:23 pm
content: Quote from: SaabFAN on July 03, 2016, 10:33:20 pmWhere can you buy such old IC anyway?

author: edavid
author_rank: Super Contributor
timestamp: July 04, 2016, 05:31:21 pm
content: Quote from: SaabFAN on July 04, 2016, 03:17:40 pmAn AVR or ARM is probably fast enough to run a MCS48 emulatorQuote from: batteksystem on July 04, 2016, 04:30:23 pmeBay or Utsource.Vintage erasable parts like this are easy to find, since they were almost always socketed.

author: voltsandjolts
author_rank: Unknown
timestamp: July 06, 2016, 07:45:23 am
content: There is a very nice German device programmer called the Galep 5 which lists D8741A as supported:http://www.conitec.com/english/galep5device_list.htmI have access to one so if you are stuck you could send it to me. I don't have a UV eraser though!

author: Kjelt
author_rank: Super Contributor
timestamp: July 06, 2016, 08:04:15 am
content: Can you read/extract the software ?Could it be an option to make an adapterpcb with a romless version of the 8741 such as the 8039 with an external eprom (2732 or modern eeprom version) ?

author: edavid
author_rank: Super Contributor
timestamp: July 06, 2016, 03:40:26 pm
content: Quote from: Kjelt on July 06, 2016, 08:04:15 amThe 8041 doesn't really support external ROM.

author: stj
author_rank: Super Contributor
timestamp: July 06, 2016, 09:13:20 pm
content: 80c41/42 from NEC do.

author: edavid
author_rank: Super Contributor
timestamp: July 06, 2016, 10:27:51 pm
content: Quote from: stj on July 06, 2016, 09:13:20 pmI don't see anything about that in the NEC uPD80C42 datasheet:http://www.mess.org/_media/datasheets/nec/upd80c42c-306.pdfDo you have a schematic for an external ROM system?

author: SaabFAN
author_rank: Frequent Contributor
timestamp: July 07, 2016, 01:16:12 am
content: Quote from: voltsandjolts on July 06, 2016, 07:45:23 amThanks for the offer, I'll send one or two chips to you if I can't get my device to program the chips.I have a UV-Eraser here (cheap ebay-thingie - just 15€ including shipping, but works and is basically the same device you can buy here for almost 70€).Quote from: Kjelt on July 06, 2016, 08:04:15 amUnfortunately not (i have an 8039, as well as an 8041 here which I got when I bought a large set of old chips on ebay).The 8741 is a Slave-Processor with the bi-directional data-bus, where the external EPROM is connected to, equipped with directly accessible input/output-buffers.In the PM6654C, these Buffers are read and written to by the 8085 CPU and are directly connected to the main data-bus, which also connects the 3 EPROMs to the CPU. That's why the 8741 or 8742 has to be used there.About my programmer:It kinda works. I get nice clean waveforms on the socket-pins and the voltages are okay.The chip is quite power-hungry though: I measured almost 60mA without any input, not even a clock, which puts the LM317LZ for the 6V-Rail right at the very edge of what is acceptable/survivable (it has to burn away 15V). Over the course of about 1 minute it didn't cut out, but it was REALLY hot!The problem I was kind of expecting with my first design (without NPN transistors) didn't fully vanish though: The lowest voltage on the pins that are supposed to have +18V maximum Voltage is 7,6V and on the VDD-Pin the lowest voltage I could see was about 10V. Adding a 10mA load did manage to eat away a few hundred millivolts, but that's still too much.Would a PullUp-Resistor from the Base to the Emitter of the PNPs help reduce that voltage? There are 1k PullDown-Resistors connected directly to the pins of the chip-socket.The 5V-Rail does have an almost perfect +5V btw.

author: stj
author_rank: Super Contributor
timestamp: July 07, 2016, 01:31:39 am
content: Quote from: edavid on July 06, 2016, 10:27:51 pmuse the EA pin to redirect rom accesses to an external multiplexed eprom.the 8048 family databook probably has example schematics.

author: edavid
author_rank: Super Contributor
timestamp: July 07, 2016, 02:50:21 am
content: Quote from: stj on July 07, 2016, 01:31:39 amIt's more difficult than with the 8048, because of the need to multiplex the data bus. I'm not sure it can be made to work in all cases.QuoteThe UPI-41 databook is separate, and has no such schematic.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: July 07, 2016, 05:58:20 pm
content: Quote from: SaabFAN on July 07, 2016, 01:16:12 am60mA is not unexpected for NMOS. You should change the regulator to a TO220 type, and put a heatsink on it.QuoteThe transistors are not turning off properly. Here is a circuit which uses an NPN transistor in Common Base mode to translate the voltage level without inverting the signal or amplifying the PNP transistor's Base current. R2 provides a discharge path for Base charge, to ensure that Q2 turns off quickly.

author: SaabFAN
author_rank: Frequent Contributor
timestamp: July 07, 2016, 11:47:28 pm
content: ARGH! /me = Idiot! I connected Collector and Emitter of the PNP the other way aroundNow the voltages are exactly what they are supposed to be and I am definitely programming something into the chip - Output-Waveforms change and I can see on the scope that the chip outputs some data when it is asked to present the data at the requested address.Unfortunately, I don't know what I have programmed: When I try to read the chip I almost always get the value 71 and sometimes 73, so I'm guessing that there is something wrong with my code (newest version attached - it runs automatically, because I accidentally fried 2 pins of the Arduino when I connected them to +21V).

author: SaabFAN
author_rank: Frequent Contributor
timestamp: July 08, 2016, 12:55:20 pm
content: I've just fired up my recently arrived PM3585 Logic Analyzer and checked the output of the Arduino - thanks again to KJDS for sending me the Disk-Images. It seems that the Arduino is sending the correct data to the 8742 (see attached screenshots).But I still can't get the Arduino to verify the results and when I put the programmed chip into the PM6654 Counter, the reed-relays start clicking like crazy, but there is nothing on the display.I'm now modifying my programmer-board so I can connect the Logic Analyzer to it.

author: SaabFAN
author_rank: Frequent Contributor
timestamp: July 08, 2016, 10:01:23 pm
content: It seems to be working now.I've managed to program one of the 8742 and it verified completely. I then put it in my PM6654C Counter and it is now apparently working again (I'm letting it run the internal test-program currently).To achieve this, I increased the Programming-Pulse width to 57ms and increased the supply-voltage to 21,5V.I can't program the other chip though (I ordered 3, one blew up when the Multimeter-probe slipped and short-circuited Supply and GND). When I try, the Arduino only reads blank memory-cells. So I'm either not giving it enough voltage, or the chip is blown.I've attached the latest version of the Arduino-Firmware for this thing and an updated Schematic (my circuit had an additional 7805 in there to supply the MCS-48 Chip because I don't have the big TO-220 LM317 in my part-box at the moment and the Arduino was connected via a bunch of short cabled coming over from the breadboard).

author: edavid
author_rank: Super Contributor
timestamp: July 08, 2016, 10:47:29 pm
content: Congratulations!Sorry if I missed something, but where did you find the PM6654C firmware?

author: SaabFAN
author_rank: Frequent Contributor
timestamp: July 09, 2016, 01:05:51 am
content: It is available on the KO4BB-Website, where I also got the Manuals, which are really good scans and the schematics even come in color!There is also the Firmware available that goes into the GPIB-Board inside the counter.

author: TK
author_rank: Super Contributor
timestamp: May 06, 2018, 01:08:54 pm
content: Quote from: SaabFAN on July 08, 2016, 10:01:23 pmThe BC237 transistors (PNP) are drawn backwards in the schematics. Emitter goes to the +18V and +23V rail. If you assemble the circuit like it is currently shown in the schematics, the voltage will switch from +23V and +11V (+18V and +9V) and not +5V which can destroy the microcontroller.

author: djsb
author_rank: Super Contributor
timestamp: May 21, 2023, 10:14:46 am
content: Has the schematic above been updated? Is it correct?

author: SaabFAN
author_rank: Frequent Contributor
timestamp: May 21, 2023, 02:24:19 pm
content: No, I haven't done anything with this after I used it to reprogram the Microcontroller that lost its programming.For anyone interested in getting a programmer like this, I would recommend this blog:https://www.mattmillman.com/projects/hveprom-project/an-easy-to-build-mcs-48-8748-8749-8741-8742-8048-8049-programmer-reader/

author: Kjelt
author_rank: Super Contributor
timestamp: May 21, 2023, 06:23:05 pm
content: Long time ago I used those uCs , IIRC you could always place an external eprom since the address and databus are multiplexed. The uCs without internal memory are also easier to find and you can even use a parallel flash e2prom.

author: edavid
author_rank: Super Contributor
timestamp: May 21, 2023, 09:14:16 pm
content: Quote from: Kjelt on May 21, 2023, 06:23:05 pmAs mentioned earlier, this doesn't work for the 8041/8042, which is what this thread is about.

author: Kjelt
author_rank: Super Contributor
timestamp: May 22, 2023, 07:36:07 am
content: Ah yes I see I already said this in 2016Old topic