AstroEQ Discussion Board

AstroEQ Forum => AstroEQ Support => Topic started by: ecc2000 on January 15, 2020, 18:07:05

Title: Bootloader Atmega 162
Post by: ecc2000 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
Title: Re: Bootloader Atmega 162
Post by: TCWORLD on January 16, 2020, 10:57:19
The easiest way is to use the AVRdude files that come with the config utility.

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
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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/
 (ftp://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
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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/ (ftp://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
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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/ (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]
Title: Re: Bootloader Atmega 162
Post by: TCWORLD 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".
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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
Title: Re: Bootloader Atmega 162
Post by: TCWORLD 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).
Title: Re: Bootloader Atmega 162
Post by: ecc2000 on January 18, 2020, 13:11:30
Ok thank you Tom, I'll keep you posted!

Have a good day !

Pierre
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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/ (http://uetianblogger.blogspot.com/2015/05/)

Thanks Tom

Pierre
Title: Re: Bootloader Atmega 162
Post by: TCWORLD 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.
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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/ (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
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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
Title: Re: Bootloader Atmega 162
Post by: ecc2000 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 (https://hardwarefun.com/tutorials/use-arduino-as-an-isp-programmer-to-program-non-arduino-avr-microcontrollers)

Thank you very much,

Pierre
Title: Re: Bootloader Atmega 162
Post by: ecc2000 on March 02, 2020, 18:58:31
Good evening,

How do we use AVRISP MKII?

What software is needed?

Pierre
Title: Re: Bootloader Atmega 162
Post by: ecc2000 on March 04, 2020, 18:55:26
Hello,

Some Tom news for the bootloader.

Obviously I managed to get it into 162!

I mounted it on a diy astroeq and it works !!!!!!!

However, you have to restart eqmod twice in the utility, otherwise it won't start!

In the sky chart the telescope moves very quickly will point very quickly in declination but is very very slow in ascent to finish its race and I cannot go faster if not I block the engine, it is not normal, it seems that there is a bad communication or relation between chart of the sky and eqmod or between chart of the sky and the utility, I don't know ?? !!

Thank you

Pierre
Title: Re: Bootloader Atmega 162
Post by: ecc2000 on March 06, 2020, 05:49:45
Hello,

Why do I have to restart Eqmod twice at the end of the configuration for it to work?

I have version 3.9.2, I reloaded Ascom and Eqmod, but nothing helps, it worked well with the Mega2560!

Otherwise for the goto it's bad it looks like there are communication problems with the sky map.

From the moment when the engine is running, I suppose that the bootloader is well fitted?

Thanks for the info, sometimes I feel like I'm talking to myself and no answers yet there are a lot of regulars here!

Thank you

Pierre
Title: Re: Bootloader Atmega 162
Post by: ecc2000 on March 06, 2020, 18:40:47
Good evening,

Everything works, but I ask my question again!

Eqmod opens at the end of the configuration but the star is crossed with a red line and it is noted timeout in eqmod!

If I relaunch Eqmod a second time in the utility there it works, I would like to have help because I only miss this problem to solve!

thank you so much

Pierre
Title: Re: Bootloader Atmega 162
Post by: ecc2000 on March 07, 2020, 15:35:28
Hello,

The trials continue!

Goto with sky map ok!

On the other hand when I simulate the port ST4, a contact of pin 32 with the ground accelerates the engine well but it remains accelerated at the speed 0,25x!

The other three pins work well, what should I do?

Is there a special configuration in Eqmod that can solve the problem?

Thank you

Pierre