MENU

Fun & Interesting

ATmega328 and PlatformIO - no Arduino!

Uwe Zimmermann 13,845 lượt xem 3 years ago
Video Not Working? Fix It Now

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

Comment