OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Which hex file for a blank atmega644 ?
- This topic has 15 replies, 3 voices, and was last updated 9 years, 8 months ago by laurent.
-
AuthorPosts
-
May 6, 2015 at 2:35 am #37410
laurentParticipantHello,
I have modify my previous post because my questions was confusing.
I want to load in a blank atmega644 the bootloader for the hardware version 2.1 (usbasp).
And after, I will use the osfwupdater, to load the firmware.
Is it the correct sequence ?
But I don’t know where I can find the bootloader file. I have tried the bootloader “ATmegaBOOT_168_atmega644.hex” with fuses (low_fuses=0xFF/high_fuses=0xDC/extended_fuses=0xFD/lock_bits=0x0F), but it doesn’t works.
For me the firmware and the bootloader is two thing different.
Actually, I’m using a Isp programmer to burn all firmwares. But I will use a bootloader
I can’t used the optiboot because the chip CH340G is very difficult to find in my country 🙁Thanks for your help and clarifications.
Regards
laurentMay 7, 2015 at 3:11 pm #37446
RayKeymasterVersion 2.1 does not use CH340G — it uses a USBasp bootlaoder, and the microcontorller itself handles USB tasks in software. I’ve attached the script and bootloader file for OS 2.1. You just need to run burn12mhz.sh (make sure you change the programmer to match whatever ISP programmer you are using). The hex file is the bootloader combined with firmware 2.0.7. Once it’s uploaded, you can upload a new firmware through OpenSprinkler’s USB port without using ISP programmer.
Attachments:
May 8, 2015 at 3:43 am #37486
laurentParticipantHello Ray,
Thanks for your support and the hex file. I have uploaded the file and now the bootloader works and the update to the last version was done successfully (2.1.4).
I have only, for avrdude, skip the parameter B -250 because I have already during my tests set all fuses to the correct value, to works with a external crystal of 12 MHz. But your are right, without the B -250 you cannot communicate with a mcu the first time.In my case, I have used your usbtiny programmer done with the ATtiny45. Thanks to share all informations to build it.
And I’m using the nice AVRDUDESS program. The GUI is more comfortable than the line command 😉 and you can save a configuration.Best regards
LaurentMay 8, 2015 at 11:09 pm #37507
RayKeymasterOK, glad to hear it worked.
May 11, 2015 at 2:01 am #37554
RadostinParticipantHi Ray!
Can you give script with combined optiboot+firmware for 2.2 hardware please?
10x in advance
May 11, 2015 at 4:06 am #37563
laurentParticipantWhy not 😉
I don’t have tried to load only the optiboot and use the OsFWUptader.
The optiboot doesn’t works when it has loaded alone without the firmware ?
Which target mcu do you have (m644 or 1284) ?
https://github.com/Optiboot/optiboot/tree/v4.4/optiboot/bootloaders/optibootMay 12, 2015 at 10:54 am #37600
RayKeymasterHere is the script for burning OS 2.2 (with firmware 2.1.2, which is an older firmware)
Attachments:
May 13, 2015 at 2:49 am #37635
laurentParticipantThanks Ray for the file 🙂 and your support.
May 21, 2015 at 9:24 am #37866
RadostinParticipantThere is no cmd/sh file with correct command lines and fuses inside the zip for OS2.2,mine OS2.2 is with 12Mhz oscillator,don’t know if there is a difference…
I’ve tried this commands and still can’t upload firmware via osFWupdater!avrdude -c usbtiny -p m644p -B 250 -F -U lfuse:w:0xFF:m -U hfuse:w:0xDC:m -U efuse:w:0xFD:m -U lock:w:0x0F:m avrdude -c usbtiny -p m644p -B 1 -F -U flash:w:combined2.1.2_16mhz.hex
10x for the help again!
May 21, 2015 at 9:41 am #37867
laurentParticipantHello randy,
This command is only to load a blank atmega m644p when no bootloader is already loaded in the atmega.
You cannot use the osFWupdater.
You must use to burn a blank atmega a programmer to program your atmega. That the problem…. Without a programmer you cannot program the bootloader.
In my case, I have buid the programmer from the idea from this page (http://rayshobby.net/opensprinkler/svc-build/usb-programming-for-opensprinkler-v1-01-1-build-instructions). You can also buy on ebay a USBasp programmer like this one: http://www.ebay.de/itm/Official-product-USBasp-programmer-green-/321737280149In the example, it’s a usbtiny programmer.
And the board 2.2 is running with a 16Mhz oscillator.May 21, 2015 at 8:53 pm #37871
RayKeymaster@Randy: I don’t understand why your OS2.2 has 12MHz. Did you buy it from us? All OS2.2 units come with 16MHz crystals.
May 22, 2015 at 1:12 am #37873
RadostinParticipant@Ray,I made OS2.2s by my self based on your schematics from github!But I’ll buy new 16Mhz crystal and will try then,but as I told you,don’t know the correct fuse settings.Can you give the correct command line please!
@Laurent I have USBtiny for ISP.
10x for the helpMay 22, 2015 at 3:28 am #37875
laurentParticipantOk Randy,
Which atmega do you have m644 / m644p ?
In any case, you don’t need a crystal to burn the firmware the first time. Because the Atmega, from factory, is programmed to run with internal oscillator.
For a test you can try check your communication with the mcu, with this command:
avrdude -c usbtiny -p m644 -B 1 -v -l log.txt
If you don’t have a correct answer, check your setting (connection/power supply) with your isp programmer.
It can be useful, to help you, to post, your actual connection with your ISP programmer and also with mcu and your drawing.
In addition, the complete log generated (log.txt).May 22, 2015 at 3:33 am #37876
RadostinParticipantMine OS2.2 is working ok with ISP and it’s alive,the problem is I can’t update/reinstall firmware from usb only,bcs of missing optiboot bootloader!!!I’m using 644p atmega.
here is the log file generated from the unit:
C:\WinAVR-20100110\bin>avrdude -c usbtiny -p m644p -B 1 -v avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf" Using Port : lpt1 Using Programmer : usbtiny Setting bit clk period : 1.0 AVR Part : ATMEGA644P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PA0 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Max W ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- --- -- --------- eeprom 65 10 128 0 no 2048 8 0 9000 90 00 0xff 0xff flash 33 6 256 0 yes 65536 256 256 4500 45 00 0xff 0xff lock 0 0 0 0 no 1 0 0 9000 90 00 0x00 0x00 lfuse 0 0 0 0 no 1 0 0 9000 90 00 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 9000 90 00 0x00 0x00 efuse 0 0 0 0 no 1 0 0 9000 90 00 0x00 0x00 signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 Programmer Type : USBtiny Description : USBtiny simple USB programmer, http://www.ladyada.net /make/usbtinyisp/ avrdude: programmer operation not supported avrdude: Setting SCK period to 1 usec avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.02s avrdude: Device signature = 0x1e960a avrdude: safemode: lfuse reads as FF avrdude: safemode: hfuse reads as D6 avrdude: safemode: efuse reads as FF avrdude: safemode: lfuse reads as FF avrdude: safemode: hfuse reads as D6 avrdude: safemode: efuse reads as FF avrdude: safemode: Fuses OK avrdude done. Thank you.
May 22, 2015 at 4:37 am #37879
laurentParticipantOK, your fuse setting seems to be ok, regarding this page:
https://github.com/rayshobby/opensprinkler/blob/master/OpenSprinkler%20Controller/software/arduino-code/hardware/aopensprinkler/boards.txtThis command is only when you have a blank mcu, to load the bootloader and the firmware:
avrdude -c usbtiny -p m644p -B 1 -F -U flash:w:combined2.1.2_16mhz.hexAfter that, can normally update you mcu with the OsfwUpdater, with the usb port.
Can you send the log file ‘log.txt’ of the OsFwUpdater ?May 22, 2015 at 4:59 am #37880
laurentParticipantin addition a good web page to calculate your fuse setting….
http://www.engbedded.com/fusecalc -
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Which hex file for a blank atmega644 ?