Improving reliability

A project log for AVR Programmer for Raspberry Pi

A simple board that lets you use the SPI interface on a Raspberry Pi to program ATMEL AVR microcontrollers.

Kevin 09/23/2017 at 16:470 Comments

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.