ATmega328 and PlatformIO - no Arduino!

  Рет қаралды 11,033

Uwe Zimmermann

Uwe Zimmermann

2 жыл бұрын

Should I abandon Microchip (Atmel) Studio for programming AVR microcontrollers?
PlatformIO, an extension for VSCode, allows not only to program Arduino code, but also plain avr-gcc including the upload with an USBasp programmer.
A student of mine showed me how to configure platformio and I had to find out that the avrdude which comes with platformio is somewhat limited in its functionality.
The necessary changes to the project's platformio.ini which I used in the video are:
[env:ATmega328P]
platform = atmelavr
board = ATmega328P
board_build.f_cpu = 1000000UL
upload_protocol = custom
upload_flags = -pm328p
-Pusb
-B4
-cusbasp
upload_command = "C:\Program Files (x86)\AVRDUDESS\avrdude.exe" $UPLOAD_FLAGS -U flash:w:$SOURCE:i

Пікірлер: 26
@siegmundeurades5753
@siegmundeurades5753 Жыл бұрын
I couldn't figure out why PlatformIO and AVRdude weren't playing nice with each other, I was just about done trying when I found this video. Good explanations and very useful information!
@Jesperrnyman
@Jesperrnyman Ай бұрын
Thank you so much!! Had so much problem with microchip studio so I really needed this😁
@shubhamforme3
@shubhamforme3 2 жыл бұрын
Thanks it was much needed , was searching for the same everywhere , very well explained.
@zdzisiekkolmaga6383
@zdzisiekkolmaga6383 Жыл бұрын
Thanks a lot, your video saves a lot of my time. I am just switching from Arduino IDE to PlatformIO.
@fransrademacher2877
@fransrademacher2877 2 жыл бұрын
Tack Uwe!! du är bäst!!!
@viniciuslongo4622
@viniciuslongo4622 Жыл бұрын
worked like a charm in Ubuntu, thanks!
@comod
@comod 7 ай бұрын
With the same tweaks or out of the box?
@eroltube100
@eroltube100 Жыл бұрын
Thank you for good explanations. I wonder whether I can use simulate this led blinking under platformio? (I use linux.)
@uwezimmermann5427
@uwezimmermann5427 Жыл бұрын
It is very difficult to realistically simulate microcontroller code. The microcontroller is supposed to react to events from the outside in realtime... There are emulation/simulation tolls around, but as far as I know none is integrated into PlatformIO.
@eroltube100
@eroltube100 Жыл бұрын
@@uwezimmermann5427 Thank you
@serdartoren
@serdartoren 7 күн бұрын
Arduino framework increases RAM usage a lot and I don't like cpp files. This is exactly what I was looking for, hopefully I'll be able to compile it into a much smaller size
@Omar.bin.khattab
@Omar.bin.khattab Жыл бұрын
thanks so much , can you help me !! how can i set linker options like (-wl,-u,vfprintf) to support floating inside platormio using vscode
@uwezimmermann5427
@uwezimmermann5427 Жыл бұрын
I haven't tried it yet, but I am just starting again for this autumn now with my students, so I might soon have a chance to explore it more... But essentially you should be able to add build_flags in platformio.ini docs.platformio.org/en/latest/projectconf/section_env_build.html#projectconf-build-flags
@Omar.bin.khattab
@Omar.bin.khattab Жыл бұрын
@@uwezimmermann5427 thanks so much
@Jptoutant
@Jptoutant 10 ай бұрын
Hey sir GREAT video! Btw what is the programmer you use to flash the chip? I would like to find an alternative to the expensive Atmel Ice
@uwezimmermann5427
@uwezimmermann5427 10 ай бұрын
I have my own construction based on Thomas Fischl's USBasp which is open source. There a lot of commercial clones of the USBasp available from Aliexpress, eBay etc. They cost somewhere between 3$ and 10$
@skmplanet9591
@skmplanet9591 2 жыл бұрын
Can you please tell me how program AT89S52 using platformio in linux without kiel
@uwezimmermann5427
@uwezimmermann5427 2 жыл бұрын
Sorry, no, I have no experience with x52-microcontrollers. Everything is different from the AVR-family.
@nurbektech
@nurbektech 2 жыл бұрын
Hi! how to make in macos with attiny13 microcontroller?
@uwezimmermann5427
@uwezimmermann5427 2 жыл бұрын
Firstly, I don't know why anyone would want to program something using a Mac... Secondly, you start a new project in VSCode/PlatformIO and select ATtiny13 as a platform. All you then need is a programmer which is supported by avrdude, grant the necessary access (however that is done on a Mac I don't know, but you can try the different Linux-tips from my previous videos), connect the ATtiny to the programmer's MOSI/MISO/SCK and flash your code.
@Patten42
@Patten42 10 ай бұрын
"I know I write code, I don't need comment" 😂Thanx for the tutorial!
@sto2779
@sto2779 Жыл бұрын
4:24 - "board_build.f_cpu" is part of the AVR's SDK syntax?
@uwezimmermann5427
@uwezimmermann5427 Жыл бұрын
it's part of the PlatformIO configuration syntax, but essentially it sets the F_CPU macro in gcc.
@dominicamoakobaah9516
@dominicamoakobaah9516 Жыл бұрын
How close is this to CMake?
@uwezimmermann5427
@uwezimmermann5427 Жыл бұрын
I have absolutely no insight into CMake, but in this video I present a plugin to VSCode - a complete IDE, which can be easily used even by people who feel uncomfortable on the commandline. I would say it has nothing to do with CMake and is not comparable in any way - apart from the fact that both can be used to produce code.
#264 PlatformIO for Arduino, ESP8266, and ESP32 Tutorial
18:47
Andreas Spiess
Рет қаралды 253 М.
Easy Migration from Arduino IDE to Platform IO Part 1 of 2
14:28
Retro Tech & Electronics
Рет қаралды 27 М.
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 6 МЛН
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 13 МЛН
Happy 4th of July 😂
00:12
Alyssa's Ways
Рет қаралды 65 МЛН
PlatformIO или прощай, Arduino IDE
35:23
Alex Morozov
Рет қаралды 156 М.
Easy Migration from Arduino IDE to Platform IO Part 2 of 2
14:33
Retro Tech & Electronics
Рет қаралды 8 М.
Bare-Metal MCU #1 - Intro to registers
13:10
Mitch Davis
Рет қаралды 69 М.
PlatformIO: All you need to know in 10 Minutes!
10:56
J's e-shack
Рет қаралды 297 М.
Bare-Metal MCU #5 - AVRDude and fuses
20:30
Mitch Davis
Рет қаралды 32 М.
Getting started with AVR and Linux command line tools
9:04
Uwe Zimmermann
Рет қаралды 9 М.
Getting started with AVR and platformio
18:09
Uwe Zimmermann
Рет қаралды 12 М.
Creating Libraries for PlatformIO
27:22
Ocean Exploration Lab
Рет қаралды 2 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 6 МЛН
АЙФОН 20 С ФУНКЦИЕЙ ВИДЕНИЯ ОГНЯ
0:59
КиноХост
Рет қаралды 1,1 МЛН
😱Хакер взломал зашифрованный ноутбук.
0:54
Последний Оплот Безопасности
Рет қаралды 981 М.
Отдых для геймера? 😮‍💨 Hiper Engine B50
1:00
Вэйми
Рет қаралды 1,3 МЛН