OpenSprinkler Forums OpenSprinkler Unified Firmware Which hex file for a blank atmega644 ?

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #37410

    laurent
    Participant

    Hello,

    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
    laurent

    #37446

    Ray
    Keymaster

    Version 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:
    #37486

    laurent
    Participant

    Hello 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
    Laurent

    #37507

    Ray
    Keymaster

    OK, glad to hear it worked.

    #37554

    Radostin
    Participant

    Hi Ray!

    Can you give script with combined optiboot+firmware for 2.2 hardware please?

    10x in advance

    #37563

    laurent
    Participant

    Why 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/optiboot

    #37600

    Ray
    Keymaster

    Here is the script for burning OS 2.2 (with firmware 2.1.2, which is an older firmware)

    Attachments:
    #37635

    laurent
    Participant

    Thanks Ray for the file 🙂 and your support.

    #37866

    Radostin
    Participant

    There 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!

    #37867

    laurent
    Participant

    Hello 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-/321737280149

    In the example, it’s a usbtiny programmer.
    And the board 2.2 is running with a 16Mhz oscillator.

    #37871

    Ray
    Keymaster

    @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.

    #37873

    Radostin
    Participant

    @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 help

    #37875

    laurent
    Participant

    Ok 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).

    #37876

    Radostin
    Participant

    Mine 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.
    #37879

    laurent
    Participant

    OK, 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.txt

    This 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.hex

    After that, can normally update you mcu with the OsfwUpdater, with the usb port.
    Can you send the log file ‘log.txt’ of the OsFwUpdater ?

    #37880

    laurent
    Participant

    in addition a good web page to calculate your fuse setting….
    http://www.engbedded.com/fusecalc

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware Which hex file for a blank atmega644 ?