Welcome, Guest. Please login or register.

Username: Password:
Pages: [1] 2

Author Topic: Bootloader Atmega 162  (Read 3987 times)

ecc2000

  • Sr. Member
  • ****
  • Posts: 72
    • 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: 809
    • 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

  • Sr. Member
  • ****
  • Posts: 72
    • 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

  • Sr. Member
  • ****
  • Posts: 72
    • 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

  • Sr. Member
  • ****
  • Posts: 72
    • 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: 809
    • 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

  • Sr. Member
  • ****
  • Posts: 72
    • 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: 809
    • 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

  • Sr. Member
  • ****
  • Posts: 72
    • 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

ecc2000

  • Sr. Member
  • ****
  • Posts: 72
    • View Profile
Re: Bootloader Atmega 162
« Reply #9 on: February 13, 2020, 17:24:55 »

Tom,

I'm going to have a problem, the shielded card I ordered for the Arduino Uno won't work, it does the Atmega16 processors well but not the 162 because the quartz is not in the right place!

How to do ?

Maybe I can use the Arduino Uno, but I need to build a special interface board for the 162, and how do I connect it to the Arduino?

Which USBASP programmer could you advise me?

Normally USBASP is recognized by the Arduino IDE, but how to upload the DOS command line with the fuses?

Thank you very much !

Pierre
Logged

ecc2000

  • Sr. Member
  • ****
  • Posts: 72
    • View Profile
Re: Bootloader Atmega 162
« Reply #10 on: February 13, 2020, 18:28:07 »

Can this assembly with the Arduino Uno work with your DOS command line?

http://uetianblogger.blogspot.com/2015/05/

Thanks Tom

Pierre
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Bootloader Atmega 162
« Reply #11 on: February 15, 2020, 00:21:31 »

It shouldn't matter that the crystal is in the wrong place, as long as the MOSI, MISO, SCLK, and RESET lines are in the correct place.

You'll be able to burn the bootloader once without a crystal, you just wont be able to program it again without the crystal once the fuses are updated.
Logged
Tom Carpenter (AstroEQ)

ecc2000

  • Sr. Member
  • ****
  • Posts: 72
    • View Profile
Re: Bootloader Atmega 162
« Reply #12 on: February 15, 2020, 10:56:30 »

Tom

I ordered this nice board designed for arduino uno, but it will not work because the power pins + and - do not correspond to 162, what a pity!

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

Is the mounting on breadboard and arduino uno mentioned in the link above good for programming?

I see the guy didn't put the quartz, is that normal?

Thank you

Pierre
Logged

ecc2000

  • Sr. Member
  • ****
  • Posts: 72
    • View Profile
Re: Bootloader Atmega 162
« Reply #13 on: February 18, 2020, 17:46:29 »

Tom, good evening,

If I understand correctly, the second command line works with WinAvr?

Thank you so much,

Regards,

Pierre
Logged

ecc2000

  • Sr. Member
  • ****
  • Posts: 72
    • View Profile
Re: Bootloader Atmega 162
« Reply #14 on: February 26, 2020, 16:09:39 »



Tom,

Is this assembly sufficient to fit the bootloader into the 162?

Should we put a quartz or not? because I see that the guy didn't wear one!?!

If yes, what value for 162? 16 or 12mhz

https://hardwarefun.com/tutorials/use-arduino-as-an-isp-programmer-to-program-non-arduino-avr-microcontrollers

Thank you very much,

Pierre
Logged
Pages: [1] 2