Summary of Atmel AVR Infrared Downloader using ATmega8
This article describes an AVR IR Downloader project developed for Electrical Engineering students at Brawijaya University. The system programs Atmel AVR microcontrollers wirelessly using infrared technology, intended for Robocon automatic machines. It features a host PC side running Lazarus Freepascal and a target device based on ATmega162, utilizing USART and Timer2 for 38 kHz modulation with CRC16 error detection.
Parts used in the AVR IR Downloader:
- Host-program for Win32 PC
- Libusb-Win32 driver
- ATmega8 microcontroller (host device)
- Firmware-only USB driver by Objective Development
- Infrared hardware unit
- Lazarus Freepascal compiler
- WinAVR (AVR-GCC) compiler
- ATmega162 microcontroller (target device)
- External SRAM 8 kbyte
- ISP interface
- CodevisionAVR compiler
- Timer2 module
- IRM-8510N data receiver
- Infrared LED array (single or six LEDs)
AVR IR Downloader is one of final assignments at Electrical Engineering Brawijaya University of Malang, Indonesia.
The basic idea was came from our lecturer at campus, Ir. Nanang Sulistyanto.
If this project was successfully made, it will be used to program our automatic machine’s uC during the testing schedule.
Actually we are using Atmel AVR series. Automatic machines are part of entire machines we have for Robocon in Indonesia (KRI).
And now we had just made it…. Thanks to our Mighty Allah SWT, Muhammad SAW our prophet and UB Robotics crews.
The host-side consist of host-program for Win32 PC using Libusb-Win32, device based on ATmega8
using firmware-only USB driver by Objective Development and infrared hardware unit.
Host program was compiled using Lazarus Freepascal. Device firmware was compiled using WinAVR (AVR-GCC).
The implementation uses custom device class, required simple inf file and libusb driver on PC.
The target-side consist of device minimum system based on ATmega162 and infrared hardware unit.
Device minimum system consist of ATmega162, external SRAM 8 kbyte and ISP interface.
Device firmware was compiled using CodevisionAVR.
Infrared data transmission uses USART facility and Timer2 for 38 kHz modulation signal generator.
Baudrate 2400bps is based on the IRM-8510N data reception ability which is 400us for the shortest length logic signal.
With a single infrared led, both host and target side can wirelessly communicate at about 6,5 meters. Final board uses
6 infrared led, can handle 15 meters length approximately.
Data packet size was limited 128 byte length because of ATmega8
SRAM at host-side was limited at 1 kbyte size. During development phase we planned to increase till 1~2 kbyte length but we avoided it.
Actually it can be increased to optimize the transfer process using a bigger SRAM AVR series. All transmission packets were
implemented using CRC16 for error detection.
Host-Side Features are:
– Device firmware is implemented as custom class device.
– Atmel AVR uC memory operations: read, write and erase.
– Memory supported: flash, eeprom and fusebits (extended also).
– Error detection during transmission through infrared implements CRC16.
– Data packet size 128 byte length, can be increased in future development.
– Can handle data transmission at about 15 meters max.
– usbpoll cannot be run while USART data transmission. USART handling is the highest priority routine to maintain infrared
communication consistency between host and target side.
For more detail: Atmel AVR Infrared Downloader using ATmega8
-
What is the primary purpose of this project?
The project is designed to program automatic machine microcontrollers during testing schedules for Robocon competitions. -
How does the system achieve wireless communication?
It uses infrared data transmission via USART facility and Timer2 for a 38 kHz modulation signal generator. -
What determines the maximum transmission distance?
A single infrared LED handles about 6.5 meters, while the final board with six LEDs can handle approximately 15 meters. -
Why is the data packet size limited to 128 bytes?
The limit exists because the host-side ATmega8 has a limited SRAM of 1 kbyte size. -
Does the system support memory operations like erase?
Yes, it supports reading, writing, and erasing flash, eeprom, and fusebits including extended bits. -
What mechanism ensures data integrity during transmission?
All transmission packets are implemented using CRC16 for error detection. -
Which software tools were used to compile the host program?
The host program was compiled using Lazarus Freepascal. -
Can the data packet size be increased in future versions?
Yes, the packet size can be increased by optimizing the transfer process using a bigger SRAM AVR series.

