09/23/2017 at 16:47 •
I have been using this interface for about a year to program an AVR microcontroller I'm using in another project. It has proven itself to be very useful but I would often get verification errors. Sometimes as often as one in three programming attempts. (I didn't keep any proper statistics. It just felt like it was that often.) I finally decided enough was enough. It was time to see if I could do something to improve the reliability of the programming process so I could reduce the number of times the programming step would fail.
I'm using a Pi Zero to program an AVR microcontroller running at 1MHz with a baudrate (-b) setting changed from its default value to 100,000. I suspected the baudrate setting as the most likely reason for the programming failures. Either the Pi or the microcontroller was not keeping up with the data stream.
I reduced the baudrate all the way down to 10,000 and tried programming the AVR multiple times. At this lower baudrate setting I never had a verify failure. I started increasing the setting until the verification step failed. The first failure I had was with a setting of 25,000. I lowered the baudrate to 20,000 and I have not experienced any more verify failures.
If you are using this interface to program an AVR microcontroller and are experiencing too many verify failures try using a lower value for the baudrate setting.
09/30/2016 at 20:57 •
The UI of the avrdude_gui program available here isn't very good but the UI of the original C++ version wasn't any better. There are too many options in the one window. UI designers seeing it are probably gagging. I don't have the time or interest to make a radical change in the look and feel of the program. What you see is the result of a quick and port of the program from C++ to Python. I just wanted something easy to use without having to keep looking up all of the command line options available in avrdude.
Porting the program from C++ to Python gave me an excuse to do a bit more programming in Python and learning more about using wxGlade to make a complicated screen layout. There are a couple of minor issues in the layout that I can't be bothered to try fixing but they are so minor most people may not even notice.
Bottom line is the program may not be pretty but it works and can be helpful in working out the command line you need to perform some operation using avrdude.
08/01/2016 at 03:53 •
I have uploaded the graphical front end that I've been using for the avrdude program. The front end program is based on a C++ program called avrdude_gui. I rewrote the C++ program in Python and used wxPython for the graphical display. I kept the general look and layout of the original C++ program but added support for many new options available in the 6.1 version of avrdude that were not available when the original C++ program was created.
08/01/2016 at 03:27 •
I have been using this interface to program an AVR microcontroller I'm using in another project. It has been working but I sometimes experienced reliability issues. The avrdude program couldn't always communicate with the AVR or the output pins of the AVR wouldn't behave properly after it was programmed. I found myself moving a wire before I used avrdude to program the AVR and moving the wire back after the programming of the AVR was complete. It soon became annoying having to do that each time I wanted to test changes to code. I started thinking if I could put the outputs of the '245 in to tri-state mode when it wasn't being used to program an AVR it would simplify things and make it easier to use the programmer.
The change needed to the circuit was minor. The reset line from the Pi can also be used as the chip enable line of the '245. When the line goes low to reset the AVR part prior to beginning the programming process it enables the outputs from the '245. When the line goes high, allowing the AVR to run the program it just received, the outputs of the '245 are put in to tri-state mode. I added a jumper to the PCB so the chip enable input of the '245 can be driven by the reset line or it can be tied to ground when the '245 is being used to buffer GPIO lines.
I added the new jumper to the schematic and PCB. While I was updating the PCB layout I made some additional changes. I modified the silkscreen so all component references can be seen and added the part values for the resistors and capacitor. I also reduced the board width by 0.05". The images in the gallery have been updated with the latest version of the schematic, PCB layout, and 3D model of an assembled board.
I have been using the modified version of the programmer for the last 5 days and it has really been a big help. I no longer need to move any wires when switching between running a program on the AVR and programming the AVR with new software.
01/09/2016 at 07:05 •
It has been a while since I last added to the project project log. I've been working on some other projects and I took a bit of a break for the Christmas holidays and new years.
I have just completed work on the instructions section for this project. There have also been additional changes to the PCB layout since I made my last project log entry.
While I was working on adding the last few items to the instructions section I thought of having an option to provide either 3.3V or 5V to external circuit but decided it was too dangerous. If the external circuit was being separately powered by 5V and the programmer board was set to provide 3.3V the external 5V power would get fed back to the 3.3V rail of the Raspberry Pi which would ruin the Pi.
The other thought that came to mind while finishing the notes for the instructions section was to make it easier to use the unused buffers in the 74LVC245. That resulted in additional changes to the PCB. I moved the resistors and the '245 to allow room for pads to allow access to the unused inputs of the '245. I then had to widen the board by 0.05" to make room for a header to be installed in the new pads and allow for the use of a socket for the '245. I think the PCB is now done and won't need any further changes, but I've thought that before while working on another PCB.
The last thing I still need to do related to this project is make my updated version of avrdude_gui available for download.
10/25/2015 at 00:31 •
The quantities of 220 ohm and 10k ohm resistors required, as stated in the components list, were around the wrong way. I have updated the required quantity for these resistors.
10/22/2015 at 20:11 •
After I made some changes to the first revision of the PCB I sent the design to OSHPark to get some boards made. It was only after I received the boards from the PCB maker that I became aware of a minor problem with the design.
There was nothing wrong with the wiring of the board. The problem was a mechanical issue. I had placed P1 beside the GPIO header. That resulted in the left side of the PCB extending out past the left edge of the Raspberry Pi PCB. This won't have any impact on the ability to use the board when the Pi is not in an enclosure. If the Pi is sitting in an enclosure there may not be enough clearance to allow the AVR programmer board to be plugged in to the GPIO header.
To fix the problem I moved the location of P1, and reduced the overall width of the board from 1.9" to 1.75". In the most recent PCB revisions I modified a few traces to shorten them and I added a ground plane to the bottom of the PCB.
I have added a 3D view of the latest revision of the AVR programmer board to the gallery. I also added front and back views of the second revision of the PCB as it was when I sent it out to OSHPark in March. I will write up some notes for the instructions section of this project page in the (I hope) near future.