Prayog board can be programmed directly from WinAVR IDE like any other AVR. You can use any programmer hardware supported by avrdude (like USBasp, USBTiny, PonySer etc) to download the Hex file onto the micro controller's flash. You can also use our USB Loader shield (Coming soon) to download the Hex data directly from WinAVR IDE. Steps for WinAVR are shown below…
Open
WinAVR IDE, There should be a blank project initially…
Write your C program for AVR in the text editing area…
Save the file as main.c in a new project folder (you can save with other name with .c extension)
WinAVR commands in Tools menu Tools→ [
WinAVR] Make Clean , [
WinAVR] Make All, [
WinAVR] Make Program, all use avr-gcc and avr-dude in the back end. avr-gcc is used for compilation of High language code written in C (e.g. main.c) and avr-dude is used for downloading the HEX file onto the flash of avr device.
WinAVR uses
MakeFile to process the commands easily. Makefiles are special kind of files that contains bunch of commands or instructions that can be executed by calling/ executing the 'make' command from commandline.
WinAVR automate the process of Code compilation, linking and programming for us using these
MakeFiles. To make your own Makefiles you can use an useful tool called mFile [
WinAVR] it a visual tool for generating
MakeFiles according to your configuration.
-
Once you have configured your own Makefile place it into the same folder as your C code file (main.c) in.
Now, you are ready to compile your code in
WinAVR IDE. Go to Tools → [
WinAVR] Make All (If everything is correct at your side, this should give no error and HEX should be generated in the folder where the Makefile and main.c (file.c) was stored)
By default Make All command generate Hex file name same as that of your .c main source file, in my case main.hex\
Connect your programmer (USBasp in my case) to the Prayog board using 10 Pin FRC connector
Its time to download this main.hex (in my case, may be different for you) onto the flash of avr device. To do that, in
WinAVR go to Tools→ [
WinAVR] Make Program. This command will use
avrdude in back end to program the flash.
avrdude will use programmer name specified by you in Makefile (e.g. USBasp in my case).
Tutorial on generating custom Makefile
If everything goes fine,, (all your connections with Programmer, Your Overall Hardware, Power Supply etc. ) it should give output something like this in the bottom pane of
WinAVR
devesh samaiya 2012/07/28 14:13 No Copyrights, Use it as if it is yours !