This is a programmer for NEC 78KOS KY1+ MCU's. It can program the following chips:-
Power is supplied to the programmer externally. This permits in-circuit programming. For example, when reprogramming the Turnigy Servo Reverser I supplied it with power from a 4.8V battery through the servo lead. This is dropped down to 3.3V via the reverser's onboard regulator, which powers both the MCU and the programmer.
Transistors T1~T3 convert RS232 serial port voltages to TTL. Serial port signals are used as follows:-
RTS OFF: Resets the target MCU
RTS ON: Releases RESET and activates the 8MHz oscillator
DTR ON: Forces MCU clock high
DTR OFF: Forces MCU clock low (when RESET is active) or sends 8MHz clock to the MCU
TD: Sends serial data to the MCU
RD: Receives serial data from the MCU
The application runs on Windows XP and above. It was written in C and compiled with MinGW32 GCC V3.4.2 under Code::Blocks.
After starting the application, connect the programmer to the serial port and target MCU. Now choose the serial port from the 'Interface' dropdown list, and click the 'Test' button to check the connection to the MCU. During the test you will be asked to turn target power on and off, to ensure that the MCU remains synchronized to the serial port. Assuming this test passes, you should then be able to perform any of the following operations:-
To speed up programming of partially blank data, 78K0Sprog skips over leading and trailing 'FF' Bytes in the write data for each block ('FF's embedded in non-blank areas are not skipped, since that would slow it down). Therefore it is possible to write to a blank area of a previously programmed block by simply ensuring that the rest of the data (before and after it) is set to 'FF'. Using the same technique it is also possible overwrite any Byte with '00', without disturbing other locations in the block.This may be useful for appending data or modifying code in a chip which has already been programmed.
I added LEDs on Vdd and TXD, RXD and DTR lines, so I could see what the programmer was doing. No project is complete without blinking LEDs!
The programmer can also be used as an RS232 to TTL
serial interface. To support full duplex operation I added a jumper
which splits the TX and RX signals, and an extra header row that the target can be plugged into to access the serial port
Frequently Asked Questions
Q: Why doesn't your programmer have a 'Read Flash' function?
A: It is not possible to read 78K0S Flash with a programmer. This is a security feature built into the chip, designed to prevent IP theft.
Q: I am a thief. How can I rip the firmware out of these chips using your programmer?
A: You can't. Go away!
Q: OK, I'm not really a thief. I just want to look at the code for 'educational purposes'.
A: You are either a liar, or a liar and a thief - the answer is still the same.