Welcome to Our Community

Some features disabled for guests. Register Today.

Atmega328 Bootloader For GRBL

Discussion in 'General Talk' started by Kyo, Oct 31, 2016.

  1. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    700
    Just a configured version of Optiboot 6.2 disabling the flashing led on D13 during power up..

    Place the two files included so named "optiboot_atmega328_d13_led_off" into your Arduino Optiboot folder under hardware. ( Folder location is dependent on OS )

    Add the following board to your boards.txt file.

    Code:
    grbl.name=Atmega328p for grbl
    
    grbl.upload.tool=avrdude
    grbl.upload.protocol=arduino
    grbl.upload.maximum_size=32256
    grbl.upload.maximum_data_size=2048
    grbl.upload.speed=115200
    
    grbl.bootloader.tool=avrdude
    grbl.bootloader.low_fuses=0xFF
    grbl.bootloader.high_fuses=0xDE
    grbl.bootloader.extended_fuses=0x05
    grbl.bootloader.unlock_bits=0x3F
    grbl.bootloader.lock_bits=0x0F
    grbl.bootloader.file=optiboot/optiboot_atmega328_d13_led_off.hex
    
    grbl.build.mcu=atmega328p
    grbl.build.f_cpu=16000000L
    grbl.build.board=AVR_UNO
    grbl.build.core=arduino
    grbl.build.variant=standard
    You can now burn your atmega328p bootloader with the Arduino IDE ( I used 1.6.12 ) If your running a Nano with 328p chip it will now act like a Uno. (smaller bootloader :) )

    The main reason to use this bootloader vs a standard install of optiboot; Will be led on pin D13 is no longer going to flash at power up or reset. If you have a relay with say a spindle attached to D13 the flashing of the led could cause it to turn on before being told to do so with G-code commands.

    I used a Arduino as ISP ( changed heart beat delay in isp sketch from 40 to 20 ) and Arduino IDE 1.6.12. This bootloader is for Atmega328P chips. Use at your own risk.

    Compiled from Optiboot source code 6.2 Using the " make LED_START_FLASHES=0 atmega328 " command
     

    Attached Files:

    Mark Carew and David the swarfer like this.
  2. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,288
    Likes Received:
    1,837
    Since I have an USBasp I have been thinking to just burn GRBL directly without a bootloader at all.
     
  3. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    700
    That works to :thumbsup: Not really a need for a bootloader other then using the usb for updating grbl and you can use the usbasp for that..
     
  4. BoneDog

    BoneDog New
    Builder

    Joined:
    Mar 5, 2017
    Messages:
    1
    Likes Received:
    1
    Well, this is a somewhat old thread, but...
    I don't own any Arduino boards that work. I have been using the AVR Toolchain and a USBTiny with Linux for years, burning bare ATmega chips with programs and using the bootloader space for more program space. However, I am not familiar with GRBL yet, so don't know if a Arduino shield is necessary for running a CNC router for PCBs. Or, just uploading the program to the Atmega, and building the hardware interface. Most likely it would be easier to use a ready-made solution for GRBL CNC control, but what is the fun in that? Have used bare AT328s for robot control via 305 MHz wireless with steppers and servos.
     
  5. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,288
    Likes Received:
    1,837
    You don't need an actual Arduino UNO
    You DO need an Atmega328p
    You DO need a USB interface for serial communication. The default is 115200 baud so make sure it can do that reliably for long periods. Do NOT use a CH430 chip, an ATmega16u2 is used on the genuine UNO and works well, though older ones need the software updated)

    So, easy/cheap is to just buy a UNO (-: (genuine with a 16u2 USB chip)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice