UNO Multi Programming Shield Tutorial Part: 3

Tutorial Part: 4 - Using batch files with the UNO Multi Programming Shield>>

Before starting to program an AVR device:

Unlink = fit the link to just one pin, Link = fit the link to both pins. The 8MHz link can be used all of the time and helps if the state of the AVR device is unknown i.e. you don't know what it was programmed for before. It does not matter what the final operating frequency of the AVR will be e.g. 16MHz or 1MHz.

AVRs are shipped by ATmel with their 8MHz internal clock selected and their "divide by 8" option selected. If the internal 8MHz clock is set and running, there should be no problem using the normal method of programming.

Preparing the AVR device:

The pins on a new AVR device are splayed out as shown in the drawing on the left. It is necessary to straighten the pins so that they are at a right-angle to the chip's body. This is the normal way to form the pins for insertion into sockets (except for ZIF sockets).

NEVER handle any chip by its pins as there is the risk that a static electrical charge on your body will damage the chip. A lot of modern chips have built-in protection against static charge but, it is very good practice to take precautions anyway. One way to protect your AVR device is to work on a sheet of aluminium foil large enough that you can rest your hands and wrists on it while you work. This has the effect of making you and the AVR  have the same electrical potential, thus preventing static charge building up. 

To form the pins, take a small metal ruler or similar thin strip of metal and lay the AVR on its side on the foil as shown, left. Push the ruler into the gap between the pins and the chip body as shown.

With the AVR body facing you, roll the AVR away from you, using your thumbs to roll the AVR and your fingers to hold the ruler in place, until the pins are at right-angles to the AVR body as shown in the second drawing.

Now, repeat the process for the pins on the other side. Remember, NEVER hold the AVR by the pins, only the body.

Your AVR is now ready for insertion into the appropriate socket on the shield.

With the ON/OFF link removed and observing the correct orientation of pin 1 of the AVR device, gently press the AVR into the appropriate socket. It is NOT necessary to fully insert the AVR into the socket. Press down evenly until resistance is felt, that's all that is needed.

If you are using the Arduino IDE select the correct Board type from the menu and choose the COM port that your Arduino UNO is using. Finally, select "Arduino as ISP" as the Programmer.

Connect the ON/OFF link and the PWR LED will light up indicating that power is now applied to the AVR. The "HB" LED should be gently pulsating which indicates that the ArduinoISP_Multi sketch is running in idle mode.

Select "Burn Bootloader" from the "Tools" menu on the IDE and programming will commence.

During programming, the PROG LED will flash when data is being written to the AVR and remain on but not flashing while data is being read from the AVR during the verification stage of programming. If you are not actually uploading a bootloader, just setting the fuses, the programming will only take a few seconds.

When programming has finished, the PROG LED will go out. The HB LED will continue to pulsate throughout the programming process. Check the output window at the bottom of the IDE for confirmation that verification was successful.

Remove the ON/OFF link and remove the AVR using your finger on the AVR's body or a small flat screwdriver if necessary. If force is required to remove the AVR from the socket, you are pressing it in too hard.

To upload sketches using the UNO Multi Programming Shield select "Arduino as ISP" from the list of programmers on the "Tools" menu.

Here it is again as bullet points:

Using the ICSP header:

It is vitally important that the ICSP header cable is correctly connected! Pin 1 of the ICSP header is identified by a WHITE dot. The ICSP signals are also shown on the shield surface. Incorrect connection of the ICSP header to the target board may lead to permanent damage to the target AVR device and other components on the board.

The picture above shows an example of using the ICSP header to program an AVR in situ. The project is a clock using an Ultra Accurate DS3231 RTC, 16x2 LCD display and 4 function buttons all off of an ATtiny85 (8 pin AVR). Power is provided by the ICSP header.

The 6 way ICSP cable is terminated on the breadboard with an ICSP break-out board on the right. The ATtiny85 is the small chip with the white label. Next comes the I2C bus header to the display, the 4 push buttons for time setting etc. and finally, the RTC module, again using I2C bus.

The advantages of using the ICSP header are that the AVR device can be left in-circuit thus preventing damage and risk of electrostatic damage by constant removal/re-insertion of the AVR device and. most importantly, a huge time saving.

Tutorial Part: 4 - Using batch files with the UNO Multi Programming Shield>>