The best way to program the ATmega32L board is through the use of a JTAG ICE (In circuit emulation) programmer. Using a JTAG ICE allows the user to debug their projects by stepping through their code while connected to, and controlling the target hardware.
Unfortunately JTAG ICE programmers are quite expensive, and Atmel has stopped producing their cheap programmers like the AVR Dragon a few year ago. The only AVR programmer on the market today that Atmel still produces is the Atmel-ICE (~$200).
(Avoid no brand 'JTAG' programmers from eBay. They are not supported in AVR/Atmel Studio above version 4.18.)
If you have faith in the code you have written, and done extensive debugging in the Simulator to ensure it works properly; there is a cheap alternative to programming AVR microcontrollers.... USBasp.
The USBasp is an open source AVR programmer made by Thomas Fischl https://www.fischl.de/usbasp/
' USBasp is a USB in-circuit programmer for Atmel AVR controllers. It simply consists of an ATMega88 or an ATMega8 and a couple of passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed. '
- https://www.fischl.de/usbasp/
The USBasp very popular, well documented, and is available to purchase from many places like Jaycar or eBay:
https://www.jaycar.com.au/isp-programmer-for-arduino-and-avr/p/XC4627
If you are a Mac or Linux user, you are in luck. The USBasp should have no driver issues with your computer.
If you are the majority using Windows however you will need to install drivers for the USBasp.
After plugging in the USBasp, download and launch Zadig.
Choose from the setting shown below to install the driver.
Select libusb-win32 as the driver you wish to install
Next you will want some code that you want to program. So go ahead and do that in Atmel Studio.
When you have finished writing you code, press the 'Build Solution' button (F7) to generate the required .HEX file.
Make note of your project's directory. You'll find the .HEX file in your project's /debug/ sub-folder.
Connect the USBasp to the ATmega32L board
Use jumper wires to make connections between the programmer and ATmega32L board as shown above.
The USBasp programmer is capable of providing power to the ATmega32L board, so the use of an additional power supply is not required.
(The USBasp connector is NOT a JTAG connection. Please do not connect it to the JTAG pins on the top of the board.)
Since we are not using a JTAG ICE programmer we can not upload programs to the ATmega32L board through Atmel Studio. (you actually can, but the process is more complicated than it needs to be, so I'm not going into that)
To upload your program via USBasp to the ATmega32L board we use software called avrdude. Those familiar with Arduino might have seen the term avrdude used before, as it is also what drives the programming function of the Arduino IDE.
avrdude is a command line based software, so I suggest using AVRDUDESS, which adds a very easy to use GUI to avrdude.
You can download AVRDUDESS here
In AVRDUDESS select the appropriate Programmer and port
Select - USBasp as the Programmer.
Select - usb as the Port
The Bit clock rate should be pre-populated when you choose the usb as Port.
Select the microcontroller (MCU) you are using
In the case of ATmega32L, choose ATmega32 as the MCU
In the Flash section, choose the .HEX file you want to program to your microcontroller
Select the .HEX file that was generated by Atmel Studio. You can find this in the /debug/ sub-folder if your project directory.
Press Program! to upload your code to the board.
ATmega32L Board Programmed with USBasp