Turning The Raspberry Pi Into A MCU Programmer

Once you graduate beyond development boards like the Arduino or Wemos D1, you’ll find yourself in the market for a dedicated programmer. In most cases, your needs can be met with a cheap USB to serial adapter that’s not much bigger than a flash drive. The only downside is that you’ve got to manually wire it up to your microcontroller of choice.

Unless you’re [Roey Benamotz], that is. He’s recently created the LEan Mean Programming mAchine (LEMPA), an add-on board for the Raspberry Pi that includes all the sockets, jumpers, and indicator LEDs you need to successfully flash a whole suite of popular MCUs. What’s more, he’s written a Python tool that handles all the nuances of getting the firmware written out.

After you’ve configured the JSON file with the information about your hardware targets and firmware files, they can easily be called up again by providing a user-defined ID name. This might seem overkill if you’re just burning the occasional hex, but if you’re doing small scale production and need to flash dozens of chips, you’ll quickly appreciate a little automation in your process.

Of course, if you’re just trying to flash some code in a pinch, there are some more expedient options out there. We’re particularly fond of using a development board to program the bare MCU.

42 thoughts on “Turning The Raspberry Pi Into A MCU Programmer

  1. What a waste of a RasPi, which is WAY overkill for this type of thing.

    Of course, in all these years I still haven’t found a good use for any of the PIs that I have accumulated along the way. They are either way overkill (both in terms of cost, power, energy, complexity, and size) for most of my electronics projects (where microcontrollers are almost always a better fit), or aren’t powerful or compatible enough for my computing projects (where a repurposed ChromeBox is usually a better fit).

    To program these AVR MCUs, there are already many sufficient solutions, including the ultra cheap USBasp clones that can be bought for $1-$2, or even just an Arduino Uno with the ArduinoISP sketch. Both of which could easily be adapted to a specialized footprint board like posted here, and could still be programmed from a PI if that is the development computer.

    I guess I just don’t see the appeal to dedicate a PI to this, but to each their own.

    1. I would not use it for a single development station but when you want to program the devices at a different station with CI/CD in between, this can help instead of wasting a whole computer just for programming.

    2. Hilarious! You freely admit that you are too close- minded to imagine an appropriate use for a Raspberry Pi yet you have no difficulty with criticizing someone who actually can find a use for one

      1. You obviously failed to understand their point, here is the key part of their comment:

        “To program these AVR MCUs, there are already many sufficient solutions, including the ultra cheap USBasp clones that can be bought for $1-$2, or even just an Arduino Uno with the ArduinoISP sketch.”

    3. Those cheap USBasp have firmware issues like being unable to program over a certain amount of memory when program Arduino Mega 2560’s. I ran into this problem programming a 3D printer board.

      1. Yeah, I had to bitbang program one with a serial adapter.
        Now use a pi zero W for anything I wanna quickly throw some serial, SPI or I2C at, since with some level conversion/protection it’s really robust.
        Just SSH into it via a Wlan connection, or emulated ethernet via its USB OTG.

    4. It looks like it’s a hat, so it’s not “dedicated”. Good use for a pi is to have it wear many hats, different hat & image for each purpose. I have a couple of Pi projects that are potentially maybe marketable, but they would be a “bring your own pi” hat if anything.

    5. If we only did things that are 100% useful, current andnot wasteful in some way, there really woudn’t be much to read about in general. So, I find this criticism a little harsh.

      That said, this reminds me of the programmers we used in the 1980s. Useful for those using DIP devices. It does have an ICSP header so it can be used for in circuit programming.

      A suggestion for V2.0 – JTAG header.

  2. This is actually a really good use for a Raspberry Pi because you can drive the io pins at very high speeds so you can program a batch of parts in much less time than it would take with those clumsy and slow usb dongles.

    1. And/or you could have loads of different programs to burn into the chips stored on a flash drive and easily be able to switch between models of micro on the fly or add new ones to the toolset with ease. I think it’s a VERY useful piece of kit, especially if you use a bunch of different micros, because you can just add in a new one with just a few lines of new code!

        1. Actually the sparkfun was the reason I created this :)
          The board is ok but a bit on the clumsy side but the software is messy, does not support ESP8266 and does not have embedded web server for configuring live system. So I created the this.
          It should be easy to change the software (it’s all open source) to use the SparkFun board.

  3. I can see how this could be helpful, although I have always programmed them in the board via 6-pin header with a NPE201-6A device. https://store.npe-inc.com/pocket-programmer-atmel-avr-isp-6-pin-128k-flash/

    I don’t think I would would a RPI because it would be to much of a hassle to make sure it was powered down properly before unplugging. I do not want to have to plug in a monitor, and keyboard just to use it, at that point might as well use my PC.
    What the maker should have added was a small character or 320×240 LCD to it to give info to the user. Then it would be more of a portable device.

        1. Given the files can stay on the Pi’s SD card, it means you can use whatever ssh capable device with a screen and keyboard of sorts as “control” devices.
          No need to juggle with files between devices unlike with a “dumb” ISP adapter.

      1. I have a couple “embedded” rpi devices where I just do a read only filesystem, with an “rw” script which makes things read-write for a subshell. If I need to upgrade or edit something, I just ssh in and run that script. It’s not 100%, but now on those devices I just turn them off if needed…

  4. I really like the creativity of makers.
    BUT: Not everything that can be done does make sense.

    Especially building a programmer for a device that does not need a programmer at all and using a Full Featured Linux device for this purpose is something that I do not understand.

    Is the reason: Because I can ?

    1. The reason is convince . I often find myself working with a tram where I work on the software and someone else on the hardware.
      This helps us create an easy to use CI/CD process – when I release a new version it automatically goes to the cloud and another team member uses this device to download, program, abs check the behavior on the real PCB with real hardware. The entire process takes less than a minute and does not require the “hardware” person to deal with GIT or file share.

  5. I am just getting into electronics. I’ve seen a. Lot of projects needing Arduino or ESP8266 etc. Do I need this device to program them ie will it make the job easier? I have a few RPis just collecting dust.

  6. > What a waste of a RasPi, which is WAY overkill for this type of thing.

    Have you seen the power demands of the ArduinoIDE? A Java foundation is a recipe for over consumption of power. But the codebase that has to be recompiled with IDE start/platform switch and the speed of the compilers it *WILL* consume the power of an rPI. It doesn’t take much imagination to come up with other uses for the capabilities of rPI in relation to developing: better code editor, access to websites, email, other ways code can get passed around. Heck you could host your Gitea powered GIT repo collection on it, to aid in bug tracking and syncing projects from other devices.

    Its an economical dev station for Arduinos. For around $100 you can give a whole preconfigured developement system to your (grand)child(ren) to encourage them to learn. How about school/teaching installations? Since it sounds like you have many PIs it certainly wouldn’t hurt to have a burning station made from one.

    I imagine if you already have a desktop system setup for programming microcontrollers it would seem a waste of effort to set up another machine (rPI or not) to do some burning. But certainly there are uses for burning more than one at a time?

    Personally I have a hard time buying a $10+ uController (board) when I can get a $10 SBC. As overkill as it may be the I hate to spend more for less. :-)

    It just takes a little imagination to see how having a full desktop capable OS available to do burning chores can benefit you. So break one of those neglected PIs out, experiment and above all have fun!

Leave a Reply to BennyCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.