M16C Flash ROM Programmer

Downloading and Info

You can get the source here.

You can get just the Linux binary compiled on my box, running Slackware 8.1 on an Intel Pentium III, here.

This programmer will hopefully do exactly what Mitsubishi's Win32 version does, except that it can be used under Linux (and other Unices). It can be run straight from the command line or as part of a Makefile.

In theory this should be faster than the Win32 version because it only writes the pages that are necessary, rather than the entire contents of the memory every time.

This program is distributed under the GNU General Public License.

Thanks to Jim for debugging and ideas.

Installation

Here is a brief procedure:

  • Edit the Makefile to your tastes.
  • Type 'make all'.
  • Copy the file 'flash' to an appropriate place, like /usr/bin.
  • Usage

    In order to use the programmer, the user as which it is run needs to have permissions to use the appropriate device in /dev. If you get errors try changing the permissions of the COM port device.

    A typical command line would be:

    flash /dev/ttyS0 M16C test.s 0:0:0:0:0:0:0

  • /dev/ttyS0 specifies the COM port device, in this case COM 1.
  • M16C specifies the CPU type, this is for future expansion.
  • test.s specifies the file that is to be flashed on to the chip.
  • 0:0:0:0:0:0:0 specifies (in hex)the 7 ID bytes that must match the ID content of the chip before flash programming can begin.
  • At the moment the programmer does not support any records in the file except S0, S2 and S8. Any other records will cause the programmer to error and die.