Yes, that is the purpose of it. It is just a modified version of the Arduino Optiboot bootloader to support the Atmega162.
The code supports both serial ports - Serial.begin() and Serial1.begin(). I have checked and they do work. It should also support PWM, but I haven't checked that. See the pins_arduino.h file to find out how the arduino pin numbers (0 to 34 inclusive) relate to the atmega162 chip pins.
Note: The atmega162 has no Analog inputs, but it does have 35 digital outputs, 6 of which work as PWMs. It has 2 serial ports, SPI, and I2C. There is however only 14kB of program space, half what an Uno has.
I found some bugs in the pins_arduino.h file, and there is also a file in the avr folder which doesn't work without a small modification. I have attached a full set of files to this post.
optiboot_atmega162.hex needs to be saved to:
\hardware\arduino\bootloaders\optiboot\optiboot_atmega162.hex
iom162.h needs to be saved to:
\hardware\tools\avr\avr\include\avr\iom162.h
(This replaces the existing one. There is a bug which prevents code from compiling otherwise. Changing the file won't affect anything other than the Atmega162).
pins_arduino.h needs to be saved to:
\hardware\arduino\variants\atmega162\pins_arduino.h
Then in the \hardware\arduino\boards.txt file, add these lines to the end:
##############################################################
atmega162.name= ATmega162
atmega162.upload.protocol=arduino
atmega162.upload.maximum_size=14336
atmega162.upload.speed=57600
atmega162.bootloader.low_fuses=0xFF
atmega162.bootloader.high_fuses=0xD8
atmega162.bootloader.extended_fuses=0xFB
atmega162.bootloader.path=optiboot
atmega162.bootloader.file=optiboot_atmega162.hex
atmega162.bootloader.unlock_bits=0x3F
atmega162.bootloader.lock_bits=0x0F
atmega162.build.mcu=atmega162
atmega162.build.f_cpu=16000000L
atmega162.build.core=arduino
atmega162.build.variant=atmega162
##############################################################
pins_arduino.h (5.16 KB)
iom162.h (20.4 KB)
optiboot_atmega162.hex (1.41 KB)