I wanted to determine the RPM on my PF906 development project separately to its PIC controller, so I thought to use an Arduino and a OLED display and the u8g2 library. It worked fine on the Arduino development platform, but I wanted to use a barebones Atmega328p to do the same (as a challenge).
I struggled to get the u8g2 library working in Atmel Studio (now Microchip studio) and eventually sorted it out. For others new to Atmel Studio and the u8g2 library this might be helpful. The u8g2 library uses Peter Fleury's i2cmaster library, so that's accessible too as a bonus for other uses.
Also please see my SPI interface video • AVR ATmega328p + 5110 ...
Materials used...
Hardware:
Microchip studio V7 ,
AVR Atmega328p,
Breakout board with 8MHz crystal clock - example... www.aliexpress...
OLED 0.96" screen with SSD1306 driver and i2c (or TWI) - example ... www.aliexpress...
Code:
u8g2 library - github.com/oli...
i2cmaster library (included with u8g2) - www.peterfleury...
+++++++++++++++++++++++
Useful links
USBasp Firmware - www.fischl.de/...
Setup USBasp in AS7:
Quick version (that can be improved by adding a ":i" at the end of the -U arguments from ~14:00 and not using "Outdir"): • Video
Longer much more detail excellent version and how to update the usbASP: • #002|English - avrdude...
6 сен 2024