-
Notifications
You must be signed in to change notification settings - Fork 1.1k
u8g2as7
kraus edited this page Jun 9, 2018
·
15 revisions
- Create a new gcc c executable project
- Enter a project "Name"
- Enter a "Solution Name"
A template main.c will be created as part of the new solution. Replace the content of this main.c with the content from here:
https://github.com/olikraus/u8g2/blob/master/sys/avr/atmega328/main.c
This example code is valid for a SPI display and will implement software emulated SPI.
- Change the pin numbers according to your project
- Change the setup procedure according to your display (select from here https://github.com/olikraus/u8g2/wiki/u8g2setupc)
Menu "Project", Submenu "u8g2_test Properties"
Menu "Project", Submenu "Add Existing Item..."
- Download the u8g2 master zip file: https://github.com/olikraus/u8g2/archive/master.zip
- Unzip this file and locate the "csrc" folder
- Mark all files in "csrc" folder
- Add the selected items (press "Add")
- Select the project
- Locate Toolchain tab
- Select "All Configurations"
- Select AVR/GNU C Compiler/Directories
- Press the green plus icon
- Add ".." as relative include path
- Press "OK".
- Select the project
- Locate Toolchain tab
- Select "All Configurations"
- Select AVR/GNU C Compiler/Symbols
- Press the green plus icon
- Add the target frequency of your controller (here: "F_CPU=8000000")
- Press "OK".
Build the complete project: Menu "Build", Submenu "Build Solution"
On my own Windows 10 environment, it was required to install a different usb driver for the AVRISP mkII. Download Zadig from here: https://zadig.akeo.ie
Open the Device Programming dialog from the "Tools" menu.
- Select your ISP tool in under "Tool".
- Select the correct target device and interface. Press "Apply" button.
- Read the device signature from your target controller by pressing the "Read" button.
- Goto "Production file" tab and select the generated .elf file as a "production file"
Check the "Flash" checkbox and press the "Program" button.