Welcome, Guest. Please login or register.

Username: Password:

Author Topic: Bootloader Atmega 162  (Read 47 times)

ecc2000

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Bootloader Atmega 162
« on: January 15, 2020, 18:07:05 »

Hello,

In parallel with the arduino mega 2560 I will try to program an Atmega 162!

I saw on Github that you had to load optiboot_atmega162.hex, but when I open it I see lines in exadecimal, should we just copy paste these lines in the arduino IDE to transfer the AVR programmer?

Thank you very much !

Pierre
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 728
    • View Profile
    • AstroEQ
Re: Bootloader Atmega 162
« Reply #1 on: January 16, 2020, 10:57:19 »

The easiest way is to use the AVRdude files that come with the config utility.

  • Save the optiboot_atmega162.hex file into the hex/ folder of the config utility
  • Open command prompt and change directory to the config utility folder (where AstroEQ.exe is located)
  • Run one of the following two commands depending on which avr programmer you are using:
ArduinoISP (chance -P\\.\COM10 to whichever COM port number your Arduino shows up as):
Code: [Select]
bin\avrdude -Cetc/avrdude.conf -v -v -v -patmega162 -cstk500v1 -P\\.\COM10 -b19200 -Uefuse:w:0xFB:m -Uhfuse:w:0xDC:m -Ulfuse:w:0xFF:m -Uflash:w:hex/optiboot_atmega162.hex:i -Ulock:w:0x0F:m
AVRISP MKII (or equiv):
Code: [Select]
bin\avrdude -Cetc/avrdude.conf -v -v -v -patmega162 -cavrispmkii -Pusb -Uefuse:w:0xFB:m -Uhfuse:w:0xDC:m -Ulfuse:w:0xFF:m -Uflash:w:hex/optiboot_atmega162.hex:i -Ulock:w:0x0F:m
Logged
Tom Carpenter (AstroEQ)

ecc2000

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Re: Bootloader Atmega 162
« Reply #2 on: January 16, 2020, 16:43:27 »

Thanks Tom,

I would like to try to program with an Arduino Uno transformed into an AVR programmer + this special 40-pin card which is intended to go with the Uno!

https://www.tindie.com/products/mfkamprath/programmer-shield-for-avr-dip40/


Sorry Tom but I don't understand the procedure, it's not clear to me, optiboot.exe, already I can't find this file!

See you later, and thank you again,

Pierre
Logged

ecc2000

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Re: Bootloader Atmega 162
« Reply #3 on: January 16, 2020, 17:52:13 »

Thanks Tom,

I would like to try to program with an Arduino Uno transformed into an AVR programmer + this special 40-pin card which is intended to go with the Uno!

https://www.tindie.com/products/mfkamprath/programmer-shield-for-avr-dip40/

Sorry Tom but I don't understand the procedure, it's not clear to me, optiboot.exe, already I can't find this file!

See you later, and thank you again,

Pierre
Logged

ecc2000

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Re: Bootloader Atmega 162
« Reply #4 on: January 16, 2020, 17:53:53 »

Thanks Tom,

I would like to try to program with an Arduino Uno transformed into an AVR programmer + this special 40-pin card which is intended to go with the Uno!

https://www.tindie.com/products/mfkamprath/programmer-shield-for-avr-dip40/

Sorry Tom but I don't understand the procedure, it's not clear to me, optiboot.exe, already I can't find this file!

See you later, and thank you again,

Pierre
[/quote]
« Last Edit: January 16, 2020, 17:58:19 by ecc2000 »
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 728
    • View Profile
    • AstroEQ
Re: Bootloader Atmega 162
« Reply #5 on: January 17, 2020, 10:05:37 »

Dear Pierre,

Please read the instructions carefully. I haven't mentioned anything called "optiboot.exe".


Download the config utility (assuming you haven't already)
https://github.com/TCWORLD/AstroEQ/raw/master/Downloads/AstroEQ-ConfigUtility.zip

Lets say you extracted the config utility to
Code: [Select]
C:\Temp\AstroEQ
Save the following file (https://github.com/TCWORLD/AstroEQ/raw/master/AstroEQ-Bootloader/optiboot_atmega162.hex) to:
Code: [Select]
C:\Temp\AstroEQ\hex\optiboot_atmega162.hex
Open windows command prompt (cmd.exe) and change directory:
Code: [Select]
cd C:\Temp\AstroEQ
As you are using ArduinoISP, enter the following command exactly as shown, changing COM10 to whatever COM port your Arduino Uno is presenting as:
Code: [Select]
bin\avrdude -Cetc/avrdude.conf -v -v -v -patmega162 -cstk500v1 -P\\.\COM10 -b19200 -Uefuse:w:0xFB:m -Uhfuse:w:0xDC:m -Ulfuse:w:0xFF:m -Uflash:w:hex/optiboot_atmega162.hex:i -Ulock:w:0x0F:m
This should burn the bootloader - if successful you will see lines like "xxx bytes verified successfully".
Logged
Tom Carpenter (AstroEQ)

ecc2000

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Re: Bootloader Atmega 162
« Reply #6 on: January 17, 2020, 18:32:27 »

Tom,

A friend came to the house and explained DOS to me, I think we got there, at least created the .hex file

The last command line ends with m?

(bin \ avrdude -Cetc / avrdude.conf -v -v -v -patmega162 -cstk500v1 -P \\. \ COM10 -b19200 -Uefuse: w: 0xFB: m -Uhfuse: w: 0xDC: m -Ulfuse: w: 0xFF: m -Uflash: w: hex / optiboot_atmega162.hex: i -Ulock: w: 0x0F: m)

So if I understand correctly it is this command line which will give the instructions to the arduino Uno and transform it into AVR?

So I don't need an Arduino ide utility actually?

When will I see the fuses?

Thank you very much, I'm learning things, good evening,

Pierre
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 728
    • View Profile
    • AstroEQ
Re: Bootloader Atmega 162
« Reply #7 on: January 18, 2020, 10:44:45 »

Hi Pierre,

Correct, you don't need the Arduino IDE. The command will basically do the same thing that the IDE does under the hood.

The fuses are embedded within the command (the -Uefuse, -Uhfuse, -Ulfuse parts).
Logged
Tom Carpenter (AstroEQ)

ecc2000

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Re: Bootloader Atmega 162
« Reply #8 on: January 18, 2020, 13:11:30 »

Ok thank you Tom, I'll keep you posted!

Have a good day !

Pierre
Logged