Arduino Forum

Using Arduino => Microcontrollers => Topic started by: Megaionstorm on Feb 26, 2011, 03:03 pm

Title: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Feb 26, 2011, 03:03 pm
Are there arduino bootloaders for atmega164, atmega324, atmega644 and atmega1284 ?

I know there is a sanguino bootloader for the atmega644 !
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: JADB on Mar 02, 2011, 05:32 am
Yep for some of those
Mark has done some good work on alot of chips - He should be able to assist you if you need something.

http://avr-developers.com/cputable.html

http://avr-developers.com/corefiles/index.html

Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 22, 2011, 02:48 pm
Hello,
I have sucessfully flashed an atmega 328 with the bootloader. Now I have an other problm. I would like to use a 644-20PU (44 pin). I read about sanguino and the 644 and 644p bootloader. Can somebody tell me if the bootlader for these 40 pin controllers will work with the 44 pin controller. I know, they have different pinout.
Thanks a lot!
Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 22, 2011, 03:30 pm
I have a Atmega644P-20PU it has 40 pins, the Atmega644PA-20PU has 40 pins too !
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 22, 2011, 04:26 pm
Hello,

I am sorry, I just saw it is a 644-20AU!
Is there a bootloader available or can I use the one vor the 40 pin version?

Thanks
Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 22, 2011, 05:25 pm
I don't know.

But you can try it.
Try to transfer the bootloader to your Atmega644, then the blinkwithoutdelay Sketch !
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 22, 2011, 06:07 pm
ok, I will try it and reply as soon as I know how it does!
thanks and a good evening!
Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 22, 2011, 06:22 pm
You can then connect a led, with a resistor, to each digital out pin.

Then you can check them with a sketch !

This show you if it react like the other atmega644 !

One led after the other !
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 22, 2011, 07:34 pm
good idea, I will make it this way.
Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 24, 2011, 11:19 am
Hello,
I've been trying for hours to get the 644-20AU running with the sanguino bootloader.
I used a Duemilanove board and this method: http://www.geocities.co.jp/arduino_diecimila/bootloader/index_en.html
I had no problems flashing Atmega 328 on the Duemilanove but encountered problems with the 644:

First I connected the 4 control pins of the FT232RL with ICSP Pins of the 644 as well as 5V supply.
Reading and setting fuses worked fine. I set

low bit FF
high bit DC
and extended bit FD

Erasing and reading flash also worked without trouble.
After writing the ATmegaBOOT_644 and ATmegaBOOT_644P I got an rc -1 error although avrdude wrote the code and an error message of different files after verifying. I read it again and the hex file was not empty.

After that I conected RX/TX and 5V from the duemilanove to the 644 and tried to flash a sketch via the FTDI chip of the board but It did not work
(avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51)
Sanguino software was of course installed and sanguino selected.

Can anyone give me a hint ?

Thanks
Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 24, 2011, 12:14 pm
I had in the past a equal problem:
http://arduino.cc/forum/index.php/topic,22205.msg166852.html#msg166852

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 24, 2011, 12:25 pm
When burning the bootloader then it's miso and mosi who are used for the transfer.

The sketch are transfered with rx and tx.

Try it with different speed settings in the serial monitor !
From the lowest to the fastest !
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 24, 2011, 12:48 pm
I tried to transfer a sketch via Rx/Tx but no way.

Is there an influence on the speed rate of the sketch-transmission when changing the serial monitor settings?
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 24, 2011, 12:56 pm
not in sync: resp=0x00

This message had give me the idea that the arduino ide and the atmega644 talks in different speed.

not in sync = not in syncronisation
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 24, 2011, 01:18 pm
ok, but what can I do then? I assume, that changing baud rate in serial monitor does not affect baud rate during sketch upload.

I have ordered a USB to TTL cable, as suggested for sanguino, yesterday. Do you know, if there are differences between this cable and the FTDI chip on a duemilanove?
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 24, 2011, 01:21 pm
Read this:
http://sanguino.cc/breadboardsanguino

under serial !
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 24, 2011, 01:28 pm
You can use a arduino without a atmega on it to transfer the sketch to the atmega644.

You must connect rx from the arduino board with the tx from the atmega644.
The tx from arduino to atmega644 rx.

Then select sanguino W/atmega644p under boards before you try to transfer the sketch !
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 24, 2011, 01:56 pm
oh, good, thanks for that!
I'm going to try this out this evening and reply with the results tomorrow!
Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 24, 2011, 09:20 pm
So, I tried to flash a sketch via arduino board without atmega and a TXRX connection to the powered 644.
Still no chance to transfer, 'not in sync'.
I fear, the bootlaoder for the 644 and 644p does not work with a 20AU chip.
Has anybody further ideas?
Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: WanaGo on Apr 25, 2011, 12:02 am
What crystal are you using?
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 25, 2011, 01:00 am
As i have tried it in the past i had used a 16Mhz crystal with the Amtega644.
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 25, 2011, 07:07 pm
Hello,
I also use a 16 MHZ crystal, same as I successfully use with a Atmega 328.
I could flash the sanguino bootloaders 644 and 644p without errors before. Flashing a sketch still doesn't work. To make sure that flashing via RXTX works, I flashed a 328 on a breadboard with 5V, Reset, RX, TX and ground connected. The 644 on a seperate pcb was connected exactly the same with 16MHZ crystal. I checked the pcb certain times and found no mistakes. As I said before, flashing bootloaders works properly.

I'll purchase a 644 20 PU tomorrow, to check weather bootloader and sketches run on it. This will let me know if the bootloader is not suitable for a 44 pin 20 AU.

If anybody had further idas, i'd apreciate.

Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 25, 2011, 07:21 pm
Could it be the Atmega644 must be resetet short before the sketch transmission ?
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 25, 2011, 07:59 pm
may be. Can this be done manually by pressing reset button with reset pins of arduino and 644 connected together?
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: Megaionstorm on Apr 25, 2011, 08:18 pm
http://arduino.cc/en/Tutorial/ArduinoToBreadboard
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on Apr 25, 2011, 08:36 pm
cheers, eventually it works! Simply pressing reset starts sketch transmission! Thank you so much!

A first test with serial interface worked at 115kBaud. The next tests concentrate on finding all IO-Ports.

Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on May 13, 2011, 12:10 pm
Hello again,

I have tried to flash the bootloader on a second 644 after the first worked properly. I used this method: http://www.geocities.co.jp/arduino_diecimila/bootloader/index_en.html

This worked well with the first 644 but not with a new raw one. The chip is soldered on a board like "breadboardsanguino" with a 16MHZ crystal. Reading the fuses of the new chip was no problem in slow mode (-B 4800). In fast mode I go an RC-1 error. Erasing worked fine as well. After setting the fuses to highfuse=DC, lowfuse=FF and extendedfuse=FD, I was no longer able to read the fuses again (error RC-1). A new crystal could not solve the problem.

My questions are:
* why is fast mode not working anymore although it worked with the first 644?
* Is the cable length from the Arduino board to the pcb crucial? (is about 25cm long)
* why can I not get trough after setting fuses for sanguino?

thx!
Robert
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: skyjumper on May 13, 2011, 03:21 pm

Hello again,

I have tried to flash the bootloader on a second 644 after the first worked properly. I used this method: http://www.geocities.co.jp/arduino_diecimila/bootloader/index_en.html

This worked well with the first 644 but not with a new raw one. The chip is soldered on a board like "breadboardsanguino" with a 16MHZ crystal. Reading the fuses of the new chip was no problem in slow mode (-B 4800). In fast mode I go an RC-1 error. Erasing worked fine as well. After setting the fuses to highfuse=DC, lowfuse=FF and extendedfuse=FD, I was no longer able to read the fuses again (error RC-1). A new crystal could not solve the problem.

My questions are:
* why is fast mode not working anymore although it worked with the first 644?
* Is the cable length from the Arduino board to the pcb crucial? (is about 25cm long)
* why can I not get trough after setting fuses for sanguino?

thx!
Robert


I just noticed this thread. I am having very similar issues. I read in the docs for the AVR Studio and somewhere else that with a brand new chip, you have the the speed very slowly, I think to 112 KHz.

A 25cm cable should be fine.

As for the fuses, I don't know.
Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: rokatz123 on May 13, 2011, 04:52 pm
yes, a brand new chip has to be adressed slowly. after erasing, transfer rate can be increased.
i'm confused, because it already worked with the same setup.

Title: Re: Arduino Bootloaders for Atmega164, Atmega324, Atmega644 and Atmega1284 ?
Post by: ladrua on Jun 08, 2011, 11:11 pm
What about Atmega 324 ?