0% found this document useful (0 votes)
115 views

(Main.c) : Programmer's Notepad New Folder ".C" Make File Without Extension

The document outlines the steps to write and compile code using the WinAVR programming environment: 1. Write code in the Programmer's Notepad and save as a .c file in a new folder. 2. Edit the makefile to specify compiler settings like MCU type and programmer. 3. Save the makefile without changing the name in the same folder as the .c file. 4. Compile and generate the hex file by using the "make all" command in the Programmer's Notepad.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

(Main.c) : Programmer's Notepad New Folder ".C" Make File Without Extension

The document outlines the steps to write and compile code using the WinAVR programming environment: 1. Write code in the Programmer's Notepad and save as a .c file in a new folder. 2. Edit the makefile to specify compiler settings like MCU type and programmer. 3. Save the makefile without changing the name in the same folder as the .c file. 4. Compile and generate the hex file by using the "make all" command in the Programmer's Notepad.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Steps to write code

1. Open the Programmers Notepad and write your code.


2. Create a new folder & save your code in that folder with extension .c (main.c) 3. Now open the make file and edit it as mentioned bellow: 4. Make file main filename (give your C file name here without extension) (main) 5. Make file enable editing make file then in your make file edit the following things: F_CPU = 16000000 (change it as per your crystal frequency)

6. Make file MCU type ATmega (chose your UC) (ATmega8535)


7. Make file Debug format AVR-ext-COFF 8. Make file Programmer select any of the available programmer type 9. Make file port select the port where you have connected your programmer 10. Save the make file in your folder without changing its name. (Makefile) 11. Now open the programmers notepad. 12. Tools make all To compile your code and to generate hex file

For another Code


Copy the previous folder (contains C code). Paste it in same place Rename the folder with a different name. Open the C file using WinAVR programmers notepad. Do necessary changes in the C file Toolsmake clean Toolsmake all

Important Notes
Makefile should be created only once. Multiple makefile should not be opened. Multiple C files should not be opened in a single IDE Name of your C file should be main.c Name of your make file should be makefile without extension A folder must should contain a C file and a make file A folder should not contain multiple C file or makefile If you are using any header file other than <avr/io.h> it should be present inside that folder and written as ex:- #include delay.h

You might also like