C Programming in Arduino?


#1

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


#2

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!!


#3

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