Skip to content

AVR: Compiling

Paciente8159 edited this page Dec 13, 2021 · 9 revisions

µCNC for AVR can be built in a couple of ways

Method one - Using the makefile (preferred)

  1. Download and install GCC tools for AVR inside your PC. You can download the latest version of GCC tool for AVR from Microchip from here.
    • If your are compiling with this method on a Windows machine you will also need to install Make. You can download Make for Windows from here and FileUtils here.
  2. Go to the uCNC src folder and edit the board cnc_config.h file if you need to select a different AVR board. µCNC is configured by default to mimic Grbl pin configuration in the Arduino UNO board.
  3. Go to the makefiles/avr folder.
    • The makefile is configured by default to compile the code for the MCU (atmega328p) and working frequency (16Mhz) in Arduino UNO board. If the chosen board has a different MCU/working frequency the makefile must be adjusted by modifying MCU = atmega328p and F_CPU = 16000000UL
  4. Open a command console inside makefiles/avr folder and run make
  5. If everything went well you should have a hex file inside makefiles/avr/build folder
  6. Now just upload µCNC to your board using an appropriate tool. xLoader for AVR is an easy tool to use.

Method one - Arduino IDE

This documentation is being updated