C Programming in Arduino?

Hello Guys!

I am doing Arduino programming in Arduino IDE for a very long time. I love Arduino IDE, but its kind of robust and easy to use. I just want to try something challenging and C language is the best. Is there any way I can program my Arduino in C language in such a way that I can access the internal registers and peripherals?

Thank You

1 Like

You can program Arduino in C language using Atmel Studio and AVRdude. The Atmel studio not configured with AVRdude by default. You have to configure it manually. For that, open ATMEL studio and go to Tool > External Tools . There you will see a form for specifying the external tool. Here you have to set up the AVRdude.exe that Arduino uses as our external tool so that ATMEL studio can use it.

Fill up the window with fields as indicated below.

  • Title : Arduino_Flasher
  • Command : C:\Program Files\Arduino\hardware\tools\avr\bin\avrdude.exe
  • Arguments : -C “C:\Program Files\Arduino\hardware\tools\avr\etc\avrdude.conf” -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:(TargetDir)(TargetName).hex:i
  • Leave the Initial Directory field empty.
  • Check mark the Use Output Window .
  • Once done OK button.

Now, AVRdude is added to Atmel studio as an external tool. Now you have to write Arduino code in C language and save it with ‘.c’ extension. Compile and click Arduino_Flasher button when you want to flash the code to Arduino.

Voila!!

5 Likes

Hey, Thanks
Everything went fine. Thank you so much once again!!

2 Likes