For flashing the binary to the board AVRDUDE is required.
# on a MAC
brew tap osx-cross/avr
brew install avr-gcc avrdude
# on Linux
sudo apt-get install gcc-avr binutils-avr gdb-avr avr-libc avrdude
# on Windows using msys2
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-avr-gcc
pacman -S mingw-w64-x86_64-avr-libc
pacman -S mingw-w64-x86_64-avrdude
Within a example folder of the software delivery (e.g. projects/ugoal/02_profinet/gcc) build the firmware with following commands:
make PLATFORM=atmega2560 clean all
Flashing the firmware is done with the following command. Please use the UART device for your system.
make PLATFORM=atmega2560 UART=/dev/tty.usbmodem141401 flash serial
The Makefile target serial will use minterm.py from the pyserial package. Thus python and pyserial needs to be installed.
On *nix systems the Makefile target serial can be used to open a serial terminal. This target uses the serial terminal from the pyserial package for python.
On windows systems a dedicated serial terminal should be used for serial logging (e.g. Putty).
Make sure following settings are set:
J13 - Connect “iRJ45” with “Sockel”
J8 - Connect “CS_SOURCE” with “PB2”
J7 - Connect “RST_SOURCE” with “PD7”
Set all DIP-Switches to “OFF”
ATMEGA 2560 Board
There is no configuration required.
Please connect both boards with each other, before you connect them per USB to your computer.
Please also see the Known Issues regarding the Connection between the ATMEGA2560 and the SoM.
In order for the SPI connection to work you need to add following wiring:
PMOD connector pin
PMOD connector pin
The ATMEGA 2560 provides a UART over USB cable. Choose the following settings:
After setting up the serial monitor and starting the debug session, the output should look like this:
Following you’ll find current limitations regarding the ATMEGA 2560.
Under specific conditions the SPI connection gets sporadically timeouts when using single wires connecting the SoM using the PMOD-Connectors. We highly recommend to separate the SPI-Signals MOSI, MISO, SCK and CS from each other using GND wires, to achieve proper shielding and a reliable SPI communication between the ATMEGA2560 and the SoM.