Тёмный

AVR ATmega328p + 128x64 OLED + some u8g2 magic - setup in Atmel (Microchip) Studio 7 

Happy Macer
Подписаться 153
Просмотров 4 тыс.
50% 1

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

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@dianalauragutierrezgodoy3620
@dianalauragutierrezgodoy3620 8 месяцев назад
THANK YOU SO MUCH, i´ve literally spent all day looking for just a bit of information of how to use the damn display without arduino. Mine uses SH1106 and worked perfectly. Thank you so much, I just suscribe and leave a like, wish I could do more for this ameazing tutorial
@Happymacer
@Happymacer 8 месяцев назад
Thankyou so much! Its comments like yours that make it all worthwhile! I'm happy to have been able to help!
@alexanderkorniyenko1639
@alexanderkorniyenko1639 2 года назад
I was very happy when I got this to work. Finally something not in arduino!
@alexanderkorniyenko1639
@alexanderkorniyenko1639 2 года назад
@@Happymacer Will you make a video on the graphics and how to code them?
@alexanderkorniyenko1639
@alexanderkorniyenko1639 2 года назад
@@Happymacer I think its fine, I found out how to do a page flip using the code. But I would be interested if there is a predefined function that would help in that.
@ucglib530
@ucglib530 3 года назад
Very nice video, thanks for sharing.
@diegoaquino8238
@diegoaquino8238 2 месяца назад
very good. How to pass a variable as a parameter to drawStr?
@Happymacer
@Happymacer 2 месяца назад
Hiya, its difficult to know what you want to do without more information...assuming you want to use a variable to replace the "Hello World!!" string, its quite simple.... Start by defining a string in an appropriate location in your code as follows: char myString[] = "Hello"; And then replace "Hello World!!" with myString in DrawStr parameter set. If you want to replace the string with a number, its a little more complicated. There is an example on the U8g2 website. One way is to use the itoa() function in C and C++ To learn more about strings see www.geeksforgeeks.org/strings-in-c/, and about itoa() have a look at www.codevscolor.com/c-itoa-function and www.geeksforgeeks.org/implement-itoa/
@taodamata9869
@taodamata9869 2 года назад
hello, do you know a driver ssd1306 for AVR AND NOT arduino? i dont work with arduino
@Drxxx
@Drxxx 3 года назад
great video super channel!
@ashoksingh4879
@ashoksingh4879 2 года назад
Dear sir, on compilation AS7 shows erro :"recipe for target 'lib/avr-hw-i2c/two master timeout.o' failed". Can you please help me to get rid of this situation.
@Happymacer_P
@Happymacer_P 2 года назад
Hi Ashok, I would love to be able to help. I’m sorry I don’t have the knowledge to diagnose those issues, and I am currently struggling with the same error myself. All I can suggest is to carefully check you have set all the project properties as per the video and that all the required directories have been created. In my case, and it’s not related to this video and might not be of any consequence to you, I was missing the “obj” directory so the compiler couldn’t write to that directory. Also read the recipe that is provided with U8g2 and check all steps are completed and adjusted as I mentioned in the video. I used that recipe for the video. Keep safe and hope you find the trouble soon.
@merlin1708
@merlin1708 Год назад
@@Happymacer_P any solutions yet? I have the same Problem and also the TW variables aint defined. How do i fix that?
@Happymacer
@Happymacer Год назад
@@merlin1708 Hi Ruben, sorry this is not an issue with my setup as per the video as I dont have that trouble, so I cant duplicate your error. It must be something youve not done quite correctly while following the video, or in your PC security permissions, or something with AS7. TW variables dont spring to mind either - sorry not sure what that means
@noegutierrez48
@noegutierrez48 2 года назад
Dude, thank you very mcuh, you just saved my ass. Like and suscribe good man
@noegutierrez48
@noegutierrez48 2 года назад
@@Happymacer I have a project with that microcontroller and I needed to use this oled display :o. Actually, I have a question about it, do you know how to use a delay with that library?
@noegutierrez48
@noegutierrez48 2 года назад
I want to set a text and after 10 seconds erase it
Далее
OLED Displays with Arduino - I2C & SPI OLEDs
41:41
Просмотров 1,1 млн
Butch REACT to Creative way to fix damaged tile!
00:46
Tutorial-1: OLED Display Programming Basics
18:47
Просмотров 21 тыс.
First ATMEGA328P Project in MPLAB X
11:35
Просмотров 17 тыс.
Writting a new Atmel Studio Oled Driver Part 1
8:03
6 Horribly Common PCB Design Mistakes
10:40
Просмотров 193 тыс.