Files
Lee Hanken 7c8efd2228 Initial commit: HPR Knowledge Base MCP Server
- MCP server with stdio transport for local use
- Search episodes, transcripts, hosts, and series
- 4,511 episodes with metadata and transcripts
- Data loader with in-memory JSON storage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 10:54:13 +00:00

187 lines
16 KiB
Plaintext

Episode: 2799
Title: HPR2799: building an arduino programmer
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr2799/hpr2799.mp3
Transcribed: 2025-10-19 16:59:35
---
This is HPR episode 2,799 entitled, building an arguingo programmer and in part of the series
arguingo and related devices, it is hosted by Brian in Ohio and in about 20 minutes long
and carrying a clean flag. The summary is turn on arguingo and into a programmer.
This episode of HBR is brought to you by AnanasThost.com.
At 15% discount on all shared hosting with the offer code HPR15, that's HPR15.
Better web hosting that's honest and fair at AnanasThost.com.
Hello Hacker Public Radio, Brian in Ohio here. I'm out here.
I'm out from under my rock at Springtime here in Northwest Ohio and I thought I'd throw together another show
and I want to tell you how I turned an Arduino Nano board into a dedicated programmer for Arduino's
and for any other kind of AVR chip you might have out there.
Motivation for doing the show was Ken Fountain's boot letter episode on HPR2660.
I've burned many boot letters, I've done the wiring it up from one Arduino to another and I thought, you know,
these little boards being so cheap, they'd be kind of cool to have a dedicated programmer built out of one of these things.
For years I've used a USB tiny programmer from Adafruit and I still have it.
But this thing I thought would be kind of cool. It's got a lot more LEDs and I just thought that putting together a program
would be a good learning experience anyway.
I still use the Arduino platform. I like it. It's easy to check out new pieces of hardware.
So let's say you've got a project and you want to try a new breakout board.
It's easy to throw a sketch together and kind of understand how the thing works before you might move on
to something more efficient than programming it in the Arduino C++C kind of language that they use.
Of course the boards are Arduino boards themselves are cheap, they're easy to find and they're pretty robust.
They take a lot of misuse and still keep running.
I also had a need to run Arduino boards at lower frequencies.
They run at 16 MHz and the chip is available. That made a 328 chip at least is available to run up to 20 MHz.
And it also can be run down to very low speeds and it has all kinds of other time or options that are kind of interesting and can lead to more efficient battery use and things like that.
So I've actually been working on a data logger that would need to run at a lower frequency.
And so I've write those kind of programs.
Outside of the Arduino environment in C, Atmel was nice enough to at least people around maybe from the open source community were able to put together compilers and a whole tool chain that's open source.
And like some other microcontrollers out there we have to pay for the compiler and things like that.
So from a hobbyist it's really kind of nice.
But it's still fun to be able to prototype something on an Arduino board before you move on and make your own PCBs and things like that.
So Arduino is still very useful.
So if you're interested in doing this project I'm going to tell you some of the things you're going to need.
It may not be exhaustive but it's the ones I've thought about the most here.
You'll need the Arduino IDE.
You can get that from where distors repository and won't go about how to install that.
If you use Slackware like you ought to.
In the Slack builds, if you search for Arduino you'll see two entries, one with a capital A and one with a little A.
I use the one with a little A. It just repactes the binaries and puts them on your system.
I had a little trouble. I couldn't get the other one to build and I already had the other tool chain set aside.
And I'm not sure if that conflicted anyway.
I got the Arduino with a little A to work on my Slackware box.
You might get AVR dude.
Again, install that. That's the program that uploads, that takes your hex file and runs it through the program and puts it on your board.
It could be useful if you want to just test out your programmer outside of the Arduino environment if you're thinking about moving on to just compiling stuff using your own make files and things like that.
I'll get into the caveat later. I'll just stick here with what you need.
You'll need an Arduino Nano clone.
You'll want to put a picture in the show notes.
I found these unassembled. I think I've got four for about $15 US dollars.
Pretty cheap, delivered.
You definitely want one that's unassembled with no pin headers soldered in.
What you're looking for is a board that has this 2x3 unpopulated pin header on the one end.
If you're not sure, just kind of compare it between the official wherever you might find it eBay or whatever.
Compare those pictures with what's on the Arduino.cc website and make sure it's the same kind of board, you know, clone of that board.
And make sure it's a nano and Arduino Nano, not a pro many.
I put on some optional LEDs, so if you want those, get some LEDs.
You need three of them. Three millimeter size or smaller is better.
If you do that, you'll need three resistors, 200 ohm or so.
Not really critical, but you want them to be physically small as you can get.
You'll need a 5 to 10 microfarad electrolytic capacitor, three to four inch long jumper wire, two by three female header.
If you buy one of these unpopulated board, they usually have the pin headers with the kit.
You'll need a 2x3 female version of, and you're not going to use the 2x3 male version that usually comes with the device that you buy.
You need something to cut wires and strip wires and you'll need soldering supplies.
All right, now on to the build.
First, you probably want to upload some kind of sketch to your nano board just to make sure it does have a boot loader.
If it doesn't, then you're going to have to go back to episode 2660 and figure out how to do that.
I just uploaded the Arduino ISP program in the examples, which is under file examples.
It's 11 Arduino ISP and then select Arduino ISP and then you can upload that sketch to your board just to make sure that it works.
The next thing that I did was I soldered on the LEDs.
Now I changed where I put the LEDs, that's easy to do.
Just modify, pull it up here.
You modify the heartbeat.
Yeah.
You modify where the pins are and it's under the defines LED, HB, LED, air, and LED pin mode.
I just changed the numbers from there.
It started out as 987 and I switched them to 975 and that's just purely because there's more space on the board to solder in the LEDs.
Started by soldering the anode leg to the appropriate digital pin on the board, the anode on the LED is usually the longer leg.
I soldered that in, I put some pictures there on the show notes to before and after.
I soldered that in, I bent the other leg around the cathode leg around and then I added a resistor to the cathode leg and then soldered the end of the resistor to a ground pin.
I started out on pin 9 and did that and you can actually test each LED before you move on to the next LED.
All you need to do is modify the sketch.
So for the first one, if you start with pin 9, it'll just work.
When you add power, you'll see the LED just pulsing slowly and that means that the program's working just fine.
Then you can, as you put on each board, you can change those pins, re-upload the sketch and then check to see that that board, that LED is flashing.
Make sure that you're, let's you know that your LEDs were soldering correctly.
Then you, the next thing I did was I took that jumper wire and I cut the end off of it, one end of it off.
And what you do is you, I ran the wire, the end you just cut off through, there's a little hole on the one far end of the board.
At least there was a mine, I put it through there, it's not kind of a strain relief.
And then ran the wire back to pin 10 and soldered it there.
Again, there's pictures in the show notes for that.
And you definitely want it to be three or four inches long at least so that it can reach across the length of the board that you might be using.
Okay, the next thing you want to solder on is the capacitor.
Things to watch out for there is that the capacitor has polarity so you want to make sure that you put the positive leg into the reset pin hole and the negative into the ground.
And I think all the nano boards have a reset on the other side.
They have reset pins on the left and the right side of the board.
I used the one on the opposite side of the LEDs, it's because there was more space there.
Either one works fine.
Before you solder that pin header in though, you want to remove the southwest connector.
That's the, I put a little picture here in the show notes too.
Don't attach, if you take your pair of pliers and pull on the piece of copper that's hanging out on that pin,
which is the reset pin, just pull it right out of there because you only want to solder up the five remaining pins.
You don't want to have reset connected.
That's reset is the wire that you soldered in earlier.
And so just remove that pin and so you'll only end up soldering five out of six pins on that six pin header.
Alright, so once you've got all that done, how do you use it?
Start by plugging your USB cable into the programmer and into your computer.
And then you want to start the Arduino IDE and you want to plug the programmer onto the target board
and put the wire, that reset wire into, put that reset wire into the reset pin of your target board.
And then in your tools folder of the IDE, make sure that you have the correct port selected for your programmer.
Whatever that is, on mine it's tools port, slash dev slash TTY USB 0 can be 1 to whatever your USB port it ends up or device driver that ends up being on.
Not sure if that's the right term.
And then in this program selection, select Arduino as an ISP, not Arduino ISP.
That's under tools programmer, Arduino as ISP, that's just select your programmer that's under tools menu.
And then you can, at that point, make sure that once you've got all that set, you can upload a program to your board.
So you might take the blink program and then you want to go and make sure that you've got the right type of target board.
For me it was an Arduino Uno.
And then here's where you do something slightly different.
Don't hit that arrow button that's on the very front of the Arduino IDE.
You want to go up the sketch, bring that menu down and then you'll see upload using a programmer.
So upload using a programmer, select that.
You should see the lights all flash on your newly built programmer.
And then you should see your board start to blink if you're successful.
You can also, if you want to, just check the functionality of your programmer at the command line.
If you don't want to, you don't want to do that, you can just go to pull up a bash prompt.
And then if you've installed a VR dude, you type in avr, dude, dash, p, m3, 2a, p, that's the kind of chip.
If you're using an Arduino Uno, dash c, which is the type of programmer, which is Arduino, dash capital p, which is the port you're using, whatever that might be.
Again, it's for me, it was slash dev slash TTY USB zero.
And then this is important, the bot rate, dash b 19, 1000, 19, 200, 19, 200.
If you hit that, you'll get an output that'll say avr devices are ready to initialize and accept instructions.
You'll see a reading kind of progress sign go by.
It'll tell you the device signature, take you the fuse, tell you what the fuses are set to.
And then it'll say you're done.
And so things to look out for, of course, with any any of these USB devices, you might have permission issues.
If you go to the arch wiki or the gen 2 wiki, you'll probably be able to figure out how to write a UDEV rule that will help you be able to use the programmer as just a regular user and not as root.
One thing to note is if you program, if you select upload using a programmer, it will overwrite your bootloader on your Arduino.
Just be careful with that.
If you want to preserve your bootloader, you cannot, right now, at least as far as I can tell, you can't upload using the programmer.
One thing I found too is some of the IDE boards text, some of the fuse, so there's a text file in the Arduino IDE software that helps with the uploading.
It's a script for the uploading of the program and they burn fuses at the same time that they upload the program.
I'm not sure why they would want to do that, but they do.
And some of those fuses selections for some of their eight megahertz chips are incorrect.
So, especially if you're running a chip without an external crystal and you upload using the Arduino IDE and you select the wrong board, you can make the board non-responsive until you hook up a crystal to it.
There's ways to fix that, but I won't go into that there.
Just something to look out for and if you're not sure, just read about it and figure it out.
You won't damage the chip, you'll have to add some crystal to it and get it back up and functioning.
Another thing is it turns out that AVR-Dude version 6.2 won't work with this programmer.
It gives some kind of IO error, so you need to use version 6.3 or 6.1, but definitely not 6.2.
And then I said earlier, but the bottom rate is critically important.
If you don't sit the bottom rate, it won't work.
Also, that capacitor on the programming board itself, it's required.
If you don't put that in, it definitely won't work.
But when you do install that, you no longer can upload programs to that board.
Unless you actually act as the reset, you have to physically hit the reset button to get it to upload as right as the Arduino ID gets done compiling.
It can be done, but it's just tricky.
So my conclusions for the project, uploading via an in-circuit serial programmer versus the USB serial.
The advantages of the in-circuit serial programming is that you can just program the device from the command line.
If you use the USB serial port and the bootloader, it can be done from the command line too, but it does take up some of your available flash memory space in the device itself.
So you lose some available programming space if you have a bootloader.
And then I started to think as I was doing this, why would I need a bootloader?
Actually, if you're a device like this, and I guess it's just for convenience.
It allows you to just have one wire hooked up to the device and do all your programming and serial communications and everything via just the one USB port, which is definitely convenient.
But you might need that 500 bytes of programming space if you write a big program, something that's really using all the resources of the device might be necessary.
I think it's a real challenge to programming these little devices.
A lot of people have seen Raspberry Pi's to do stuff that an Arduino can do, or even funnier is when they take a Raspberry Pi and they dangle, hang off an Arduino, and they're just using the Raspberry Pi almost like a desktop to run the device.
And there's all kinds of solutions, all kinds of problems.
But I just find an interesting solution sometimes that seems to be more complex than they need to.
Somebody once told me that if you need to do one or two things in a project, maybe a microcontroller is the way you want to go in Arduino or something like that.
And if you do have to do many things, blogging and multiple interfaces and many, many sensors, maybe that's the time to go to one of these Linux single board computers like a Raspberry Pi.
Anyway, I hope this was interesting and informative. If you have any questions, go ahead and email me.
If you build one yourself and have any problems or learn something new, maybe you'll make a doing episode or if you think it's...
If you want to talk more about microcontrollers, do an episode about that too.
Thanks for listening. Brian and Ohio, signing out.
You've been listening to Heka Public Radio at HekaPublicRadio.org.
We are a community podcast network that releases shows every weekday, Monday through Friday.
Today's show, like all our shows, was contributed by an HPR listener like yourself.
If you ever thought of recording a podcast, then click on our contributing to find out how easy it really is.
Heka Public Radio was founded by the digital dog pound and the Infonomicon Computer Club, and is part of the binary revolution at binrev.com.
If you have comments on today's show, please email the host directly, leave a comment on the website or record a follow-up episode yourself.
Unless otherwise stated, today's show is released under Creative Commons, Attribution, ShareLife, 3.0 license.