<?xml version="1.0" encoding="utf-8"?>
				<!-- generator="e107" -->
				<!-- content type="Forum / topic" -->
				<rss  version="2.0">
				<channel>
				<title>8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes : Forum / topic</title>
				<link>http://www.8051projects.net/</link>
				<description>Learn to make simple microcontroller projects, pic, 8051, avr and arm projects. download 8051 projects, tutorials, libraries, sample codes. join the microcontroller discussion forum and ask doubts regarding electronics. the best source for 8051 over internet.</description>

<language>en-gb</language>
				<copyright><a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/in/" target="_blank"><img alt="Creative Commons License" width="80" height="15" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/2.5/in/80x15.png" target="_blank" /></a>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/in/" target="_blank">Creative Commons Attribution-Noncommercial 2.5 India License</a>.<a href='http://www.8051projects.net/disclaimer.htm' target='_blank' />Rickey's World Disclaimer</a></copyright>
				<managingEditor>Ajay Bhargav - contact@nospam.com</managingEditor>
				<webMaster>contact@nospam.com</webMaster>
				<pubDate>Mon, 01 Dec 2008 11:52:49 -0800</pubDate>
				<lastBuildDate>Mon, 01 Dec 2008 11:52:49 -0800</lastBuildDate>
				<docs>http://backend.userland.com/rss</docs>
				<generator>e107 (http://e107.org)</generator>
				<ttl>60</ttl>
				<textInput>
				<title>Search</title>
				<description>Search 8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes</description>
				<name>query</name>
				<link>http://www.8051projects.net/search.php</link>
				</textInput>
						<item>
						<title>problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[i am using a atmega 16L mc. i did the coding in winavr(latest edition). also i am using a spi flash programmer 3.7. it detects the mc but gives an error ----<br /><br /><br />my coding---<br /> <div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;"><br /><span style="color: #339933;">#include &lt;avr/io.h&gt;</span><br /><span style="color: #339933;">#include &lt;avr/delay.h&gt;</span><br /><br /><span style="color: #993333;">int</span> main <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">void</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br /><span style="color: #808080; font-style: italic;">// set PORTD for output</span><br />DDRD = 0xFF;<br /><br /><span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br /><br /><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color: #cc66cc;">1</span>; i &lt;= <span style="color: #cc66cc;">128</span>; i = i*<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />PORTD = i;<br />_delay_loop_2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">30000</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color: #cc66cc;">128</span>; i &gt; <span style="color: #cc66cc;">1</span>; i -= i/<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />PORTD = i;<br />_delay_loop_2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">30000</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #66cc66;">&#125;</span><br />&nbsp;</div></div> <br /><br />makefile config -------<br /> <div class='indent'><br /># Hey Emacs, this is a -*- makefile -*-<br />#----------------------------------------------------------------------------<br /># WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.<br />#<br /># Released to the Public Domain<br />#<br /># Additional material for this makefile was written by:<br /># Peter Fleury<br /># Tim Henigan<br /># Colin O'Flynn<br /># Reiner Patommel<br /># Markus Pfaff<br /># Sander Pool<br /># Frederik Rouleau<br /># Carlos Lamas<br />#<br />#----------------------------------------------------------------------------<br /># On command line:<br />#<br /># make all = Make software.<br />#<br /># make clean = Clean out built project files.<br />#<br /># make coff = Convert ELF to AVR COFF.<br />#<br /># make extcoff = Convert ELF to AVR Extended COFF.<br />#<br /># make program = Download the hex file to the device, using avrdude.<br />#                Please customize the avrdude settings below first!<br />#<br /># make debug = Start either simulavr or avarice as specified for debugging, <br />#              with avr-gdb or avr-insight as the front end for debugging.<br />#<br /># make filename.s = Just compile filename.c into the assembler code only.<br />#<br /># make filename.i = Create a preprocessed source file for use in submitting<br />#                   bug reports to the GCC project.<br />#<br /># To rebuild project do "make clean" then "make all".<br />#----------------------------------------------------------------------------<br /><br /><br /># MCU name<br />MCU = atmega16<br /><br /><br /># Processor frequency.<br />#     This will define a symbol, F_CPU, in all source code files equal to the <br />#     processor frequency. You can then use this symbol in your source code to <br />#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done<br />#     automatically to create a 32-bit value in your source code.<br />#     Typical values are:<br />#         F_CPU =  1000000<br />#         F_CPU =  1843200<br />#         F_CPU =  2000000<br />#         F_CPU =  3686400<br />#         F_CPU =  4000000<br />#         F_CPU =  7372800<br />#         F_CPU =  8000000<br />#         F_CPU = 11059200<br />#         F_CPU = 14745600<br />#         F_CPU = 16000000<br />#         F_CPU = 18432000<br />#         F_CPU = 20000000<br />F_CPU = 1000000<br /><br /><br /># Output format. (can be srec, ihex, binary)<br />FORMAT = ihex<br /><br /><br /># Target file name (without extension).<br />TARGET = blinky<br /><br /><br /># Object files directory<br />#     To put object files in current directory, use a dot (.), do NOT make<br />#     this an empty or blank macro!<br />OBJDIR = .<br /><br /><br /># List C source files here. (C dependencies are automatically generated.)<br />SRC = $(TARGET).c<br /><br /><br /># List C++ source files here. (C dependencies are automatically generated.)<br />CPPSRC = <br /><br /><br /># List Assembler source files here.<br />#     Make them always end in a capital .S.  Files ending in a lowercase .s<br />#     will not be considered source files but generated files (assembler<br />#     output from the compiler), and will be deleted upon "make clean"!<br />#     Even though the DOS/Win* filesystem matches both .s and .S the same,<br />#     it will preserve the spelling of the filenames, and gcc itself does<br />#     care about how the name is spelled on its command-line.<br />ASRC =<br /><br /><br /># Optimization level, can be [0, 1, 2, 3, s]. <br />#     0 = turn off optimization. s = optimize for size.<br />#     (Note: 3 is not always the best optimization level. See avr-libc FAQ.)<br />OPT = s<br /><br /><br /># Debugging format.<br />#     Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.<br />#     AVR Studio 4.10 requires dwarf-2.<br />#     AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.<br />DEBUG = stabs<br /><br /><br /># List any extra directories to look for include files here.<br />#     Each directory must be seperated by a space.<br />#     Use forward slashes for directory separators.<br />#     For a directory that has spaces, enclose it in quotes.<br />EXTRAINCDIRS = <br /><br /><br /># Compiler flag to set the C Standard level.<br />#     c89   = "ANSI" C<br />#     gnu89 = c89 plus GCC extensions<br />#     c99   = ISO C99 standard (not yet fully implemented)<br />#     gnu99 = c99 plus GCC extensions<br />CSTANDARD = -std=gnu99<br /><br /><br /># Place -D or -U options here for C sources<br />CDEFS = -DF_CPU=$(F_CPU)UL<br /><br /><br /># Place -D or -U options here for ASM sources<br />ADEFS = -DF_CPU=$(F_CPU)<br /><br /><br /># Place -D or -U options here for C++ sources<br />CPPDEFS = -DF_CPU=$(F_CPU)UL<br />#CPPDEFS += -D__STDC_LIMIT_MACROS<br />#CPPDEFS += -D__STDC_CONSTANT_MACROS<br /><br /><br /><br />#---------------- Compiler Options C ----------------<br />#  -g*:          generate debugging information<br />#  -O*:          optimization level<br />#  -f...:        tuning, see GCC manual and avr-libc documentation<br />#  -Wall...:     warning level<br />#  -Wa,...:      tell GCC to pass this to the assembler.<br />#    -adhlns...: create assembler listing<br />CFLAGS = -g$(DEBUG)<br />CFLAGS += $(CDEFS)<br />CFLAGS += -O$(OPT)<br />CFLAGS += -funsigned-char<br />CFLAGS += -funsigned-bitfields<br />CFLAGS += -fpack-struct<br />CFLAGS += -fshort-enums<br />CFLAGS += -Wall<br />CFLAGS += -Wstrict-prototypes<br />#CFLAGS += -mshort-calls<br />#CFLAGS += -fno-unit-at-a-time<br />#CFLAGS += -Wundef<br />#CFLAGS += -Wunreachable-code<br />#CFLAGS += -Wsign-compare<br />CFLAGS += -Wa,-adhlns=$(&lt;:%.c=$(OBJDIR)/%.lst)<br />CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))<br />CFLAGS += $(CSTANDARD)<br /><br /><br />#---------------- Compiler Options C++ ----------------<br />#  -g*:          generate debugging information<br />#  -O*:          optimization level<br />#  -f...:        tuning, see GCC manual and avr-libc documentation<br />#  -Wall...:     warning level<br />#  -Wa,...:      tell GCC to pass this to the assembler.<br />#    -adhlns...: create assembler listing<br />CPPFLAGS = -g$(DEBUG)<br />CPPFLAGS += $(CPPDEFS)<br />CPPFLAGS += -O$(OPT)<br />CPPFLAGS += -funsigned-char<br />CPPFLAGS += -funsigned-bitfields<br />CPPFLAGS += -fpack-struct<br />CPPFLAGS += -fshort-enums<br />CPPFLAGS += -fno-exceptions<br />CPPFLAGS += -Wall<br />CFLAGS += -Wundef<br />#CPPFLAGS += -mshort-calls<br />#CPPFLAGS += -fno-unit-at-a-time<br />#CPPFLAGS += -Wstrict-prototypes<br />#CPPFLAGS += -Wunreachable-code<br />#CPPFLAGS += -Wsign-compare<br />CPPFLAGS += -Wa,-adhlns=$(&lt;:%.cpp=$(OBJDIR)/%.lst)<br />CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))<br />#CPPFLAGS += $(CSTANDARD)<br /><br /><br />#---------------- Assembler Options ----------------<br />#  -Wa,...:   tell GCC to pass this to the assembler.<br />#  -adhlns:   create listing<br />#  -gstabs:   have the assembler create line number information; note that<br />#             for use in COFF files, additional information about filenames<br />#             and function names needs to be present in the assembler source<br />#             files -- see avr-libc docs [FIXME: not yet described there]<br />#  -listing-cont-lines: Sets the maximum number of continuation lines of hex <br />#       dump that will be displayed for a given single line of source input.<br />ASFLAGS = $(ADEFS) -Wa,-adhlns=$(&lt;:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100<br /><br /><br />#---------------- Library Options ----------------<br /># Minimalistic printf version<br />PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min<br /><br /># Floating point printf version (requires MATH_LIB = -lm below)<br />PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt<br /><br /># If this is left blank, then it will use the Standard printf version.<br />PRINTF_LIB = <br />#PRINTF_LIB = $(PRINTF_LIB_MIN)<br />#PRINTF_LIB = $(PRINTF_LIB_FLOAT)<br /><br /><br /># Minimalistic scanf version<br />SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min<br /><br /># Floating point + %[ scanf version (requires MATH_LIB = -lm below)<br />SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt<br /><br /># If this is left blank, then it will use the Standard scanf version.<br />SCANF_LIB = <br />#SCANF_LIB = $(SCANF_LIB_MIN)<br />#SCANF_LIB = $(SCANF_LIB_FLOAT)<br /><br /><br />MATH_LIB = -lm<br /><br /><br /># List any extra directories to look for libraries here.<br />#     Each directory must be seperated by a space.<br />#     Use forward slashes for directory separators.<br />#     For a directory that has spaces, enclose it in quotes.<br />EXTRALIBDIRS = <br /><br /><br /><br />#---------------- External Memory Options ----------------<br /><br /># 64 KB of external RAM, starting after internal RAM (ATmega128!),<br /># used for variables (.data/.bss) and heap (malloc()).<br />#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff<br /><br /># 64 KB of external RAM, starting after internal RAM (ATmega128!),<br /># only used for heap (malloc()).<br />#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff<br /><br />EXTMEMOPTS =<br /><br /><br /><br />#---------------- Linker Options ----------------<br />#  -Wl,...:     tell GCC to pass this to linker.<br />#    -Map:      create map file<br />#    --cref:    add cross reference to  map file<br />LDFLAGS = -Wl,-Map=$(TARGET).map,--cref<br />LDFLAGS += $(EXTMEMOPTS)<br />LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))<br />LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)<br />#LDFLAGS += -T linker_script.x<br /><br /><br /><br />#---------------- Programming Options (avrdude) ----------------<br /><br /># Programming hardware<br /># Type: avrdude -c ?<br /># to get a full listing.<br />#<br />AVRDUDE_PROGRAMMER = bsd<br /><br /># com1 = serial port. Use lpt1 to connect to parallel port.<br />AVRDUDE_PORT = lpt1<br /><br />AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex<br />#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep<br /><br /><br /># Uncomment the following if you want avrdude's erase cycle counter.<br /># Note that this counter needs to be initialized first using -Yn,<br /># see avrdude manual.<br />#AVRDUDE_ERASE_COUNTER = -y<br /><br /># Uncomment the following if you do /not/ wish a verification to be<br /># performed after programming the device.<br />#AVRDUDE_NO_VERIFY = -V<br /><br /># Increase verbosity level.  Please use this when submitting bug<br /># reports about avrdude. See &lt;http://savannah.nongnu.org/projects/avrdude> <br /># to submit bug reports.<br />#AVRDUDE_VERBOSE = -v -v<br /><br />AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)<br />AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)<br />AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)<br />AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)<br /><br /><br /><br />#---------------- Debugging Options ----------------<br /><br /># For simulavr only - target MCU frequency.<br />DEBUG_MFREQ = $(F_CPU)<br /><br /># Set the DEBUG_UI to either gdb or insight.<br /># DEBUG_UI = gdb<br />DEBUG_UI = insight<br /><br /># Set the debugging back-end to either avarice, simulavr.<br />DEBUG_BACKEND = avarice<br />#DEBUG_BACKEND = simulavr<br /><br /># GDB Init Filename.<br />GDBINIT_FILE = __avr_gdbinit<br /><br /># When using avarice settings for the JTAG<br />JTAG_DEV = /dev/com1<br /><br /># Debugging port used to communicate between GDB / avarice / simulavr.<br />DEBUG_PORT = 4242<br /><br /># Debugging host used to communicate between GDB / avarice / simulavr, normally<br />#     just set to localhost unless doing some sort of crazy debugging when <br />#     avarice is running on a different computer.<br />DEBUG_HOST = localhost<br /><br /><br /><br />#============================================================================<br /><br /><br /># Define programs and commands.<br />SHELL = sh<br />CC = avr-gcc<br />OBJCOPY = avr-objcopy<br />OBJDUMP = avr-objdump<br />SIZE = avr-size<br />AR = avr-ar rcs<br />NM = avr-nm<br />AVRDUDE = avrdude<br />REMOVE = rm -f<br />REMOVEDIR = rm -rf<br />COPY = cp<br />WINSHELL = cmd<br /><br /><br /># Define Messages<br /># English<br />MSG_ERRORS_NONE = Errors: none<br />MSG_BEGIN = -------- begin --------<br />MSG_END = --------  end  --------<br />MSG_SIZE_BEFORE = Size before: <br />MSG_SIZE_AFTER = Size after:<br />MSG_COFF = Converting to AVR COFF:<br />MSG_EXTENDED_COFF = Converting to AVR Extended COFF:<br />MSG_FLASH = Creating load file for Flash:<br />MSG_EEPROM = Creating load file for EEPROM:<br />MSG_EXTENDED_LISTING = Creating Extended Listing:<br />MSG_SYMBOL_TABLE = Creating Symbol Table:<br />MSG_LINKING = Linking:<br />MSG_COMPILING = Compiling C:<br />MSG_COMPILING_CPP = Compiling C++:<br />MSG_ASSEMBLING = Assembling:<br />MSG_CLEANING = Cleaning project:<br />MSG_CREATING_LIBRARY = Creating library:<br /><br /><br /><br /><br /># Define all object files.<br />OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) <br /><br /># Define all listing files.<br />LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) <br /><br /><br /># Compiler flags to generate dependency files.<br />GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d<br /><br /><br /># Combine all necessary flags and optional flags.<br /># Add target processor to flags.<br />ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)<br />ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)<br />ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)<br /><br /><br /><br /><br /><br /># Default target.<br />all: begin gccversion sizebefore build sizeafter end<br /><br /># Change the build target to build a HEX file or a library.<br />build: elf hex eep lss sym extcoff<br />#build: lib<br /><br /><br />elf: $(TARGET).elf<br />hex: $(TARGET).hex<br />eep: $(TARGET).eep<br />lss: $(TARGET).lss<br />sym: $(TARGET).sym<br />LIBNAME=lib$(TARGET).a<br />lib: $(LIBNAME)<br /><br /><br /><br /># Eye candy.<br /># AVR Studio 3.x does not check make's exit code but relies on<br /># the following magic strings to be generated by the compile job.<br />begin:<br />	@echo<br />	@echo $(MSG_BEGIN)<br /><br />end:<br />	@echo $(MSG_END)<br />	@echo<br /><br /><br /># Display size of file.<br />HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex<br />ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf<br /><br />sizebefore:<br />	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); &#092;<br />	2>/dev/null; echo; fi<br /><br />sizeafter:<br />	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); &#092;<br />	2>/dev/null; echo; fi<br /><br /><br /><br /># Display compiler version information.<br />gccversion : <br />	@$(CC) --version<br /><br /><br /><br /># Program the device.  <br />program: $(TARGET).hex $(TARGET).eep<br />	$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)<br /><br /><br /># Generate avr-gdb config/init file which does the following:<br />#     define the reset signal, load the target file, connect to target, and set <br />#     a breakpoint at main().<br />gdb-config: <br />	@$(REMOVE) $(GDBINIT_FILE)<br />	@echo define reset >> $(GDBINIT_FILE)<br />	@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)<br />	@echo end >> $(GDBINIT_FILE)<br />	@echo file $(TARGET).elf >> $(GDBINIT_FILE)<br />	@echo target remote $(DEBUG_HOST):$(DEBUG_PORT)  >> $(GDBINIT_FILE)<br />ifeq ($(DEBUG_BACKEND),simulavr)<br />	@echo load  >> $(GDBINIT_FILE)<br />endif<br />	@echo break main >> $(GDBINIT_FILE)<br /><br />debug: gdb-config $(TARGET).elf<br />ifeq ($(DEBUG_BACKEND), avarice)<br />	@echo Starting AVaRICE - Press enter when "waiting to connect" message displays.<br />	@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file &#092;<br />	$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)<br />	@$(WINSHELL) /c pause<br /><br />else<br />	@$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq &#092;<br />	$(DEBUG_MFREQ) --port $(DEBUG_PORT)<br />endif<br />	@$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)<br /><br /><br /><br /><br /># Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.<br />COFFCONVERT = $(OBJCOPY) --debugging<br />COFFCONVERT += --change-section-address .data-0x800000<br />COFFCONVERT += --change-section-address .bss-0x800000<br />COFFCONVERT += --change-section-address .noinit-0x800000<br />COFFCONVERT += --change-section-address .eeprom-0x810000<br /><br /><br /><br />coff: $(TARGET).elf<br />	@echo<br />	@echo $(MSG_COFF) $(TARGET).cof<br />	$(COFFCONVERT) -O coff-avr $&lt; $(TARGET).cof<br /><br /><br />extcoff: $(TARGET).elf<br />	@echo<br />	@echo $(MSG_EXTENDED_COFF) $(TARGET).cof<br />	$(COFFCONVERT) -O coff-ext-avr $&lt; $(TARGET).cof<br /><br /><br /><br /># Create final output files (.hex, .eep) from ELF output file.<br />%.hex: %.elf<br />	@echo<br />	@echo $(MSG_FLASH) $@<br />	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $&lt; $@<br /><br />%.eep: %.elf<br />	@echo<br />	@echo $(MSG_EEPROM) $@<br />	-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" &#092;<br />	--change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $&lt; $@ || exit 0<br /><br /># Create extended listing file from ELF output file.<br />%.lss: %.elf<br />	@echo<br />	@echo $(MSG_EXTENDED_LISTING) $@<br />	$(OBJDUMP) -h -S -z $&lt; > $@<br /><br /># Create a symbol table from ELF output file.<br />%.sym: %.elf<br />	@echo<br />	@echo $(MSG_SYMBOL_TABLE) $@<br />	$(NM) -n $&lt; > $@<br /><br /><br /><br /># Create library from object files.<br />.SECONDARY : $(TARGET).a<br />.PRECIOUS : $(OBJ)<br />%.a: $(OBJ)<br />	@echo<br />	@echo $(MSG_CREATING_LIBRARY) $@<br />	$(AR) $@ $(OBJ)<br /><br /><br /># Link: create ELF output file from object files.<br />.SECONDARY : $(TARGET).elf<br />.PRECIOUS : $(OBJ)<br />%.elf: $(OBJ)<br />	@echo<br />	@echo $(MSG_LINKING) $@<br />	$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)<br /><br /><br /># Compile: create object files from C source files.<br />$(OBJDIR)/%.o : %.c<br />	@echo<br />	@echo $(MSG_COMPILING) $&lt;<br />	$(CC) -c $(ALL_CFLAGS) $&lt; -o $@ <br /><br /><br /># Compile: create object files from C++ source files.<br />$(OBJDIR)/%.o : %.cpp<br />	@echo<br />	@echo $(MSG_COMPILING_CPP) $&lt;<br />	$(CC) -c $(ALL_CPPFLAGS) $&lt; -o $@ <br /><br /><br /># Compile: create assembler files from C source files.<br />%.s : %.c<br />	$(CC) -S $(ALL_CFLAGS) $&lt; -o $@<br /><br /><br /># Compile: create assembler files from C++ source files.<br />%.s : %.cpp<br />	$(CC) -S $(ALL_CPPFLAGS) $&lt; -o $@<br /><br /><br /># Assemble: create object files from assembler source files.<br />$(OBJDIR)/%.o : %.S<br />	@echo<br />	@echo $(MSG_ASSEMBLING) $&lt;<br />	$(CC) -c $(ALL_ASFLAGS) $&lt; -o $@<br /><br /><br /># Create preprocessed source for use in sending a bug report.<br />%.i : %.c<br />	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $&lt; -o $@ <br /><br /><br /># Target: clean project.<br />clean: begin clean_list end<br /><br />clean_list :<br />	@echo<br />	@echo $(MSG_CLEANING)<br />	$(REMOVE) $(TARGET).hex<br />	$(REMOVE) $(TARGET).eep<br />	$(REMOVE) $(TARGET).cof<br />	$(REMOVE) $(TARGET).elf<br />	$(REMOVE) $(TARGET).map<br />	$(REMOVE) $(TARGET).sym<br />	$(REMOVE) $(TARGET).lss<br />	$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)<br />	$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)<br />	$(REMOVE) $(SRC:.c=.s)<br />	$(REMOVE) $(SRC:.c=.d)<br />	$(REMOVE) $(SRC:.c=.i)<br />	$(REMOVEDIR) .dep<br /><br /><br /># Create object files directory<br />$(shell mkdir $(OBJDIR) 2>/dev/null)<br /><br /><br /># Include the dependency files.<br />-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)<br /><br /><br /># Listing of phony targets.<br />.PHONY : all begin finish end sizebefore sizeafter gccversion &#092;<br />build elf hex eep lss sym coff extcoff &#092;<br />clean clean_list program debug gdb-config<br /><br /><br /><br /></div> <br /><br /><br />error ---<br /><br /><br /><img src='http://www.8051projects.net/e107_files/public/1214142083_3897_FT0_456546.jpg' class='bbcode' alt='' width='457' height='433'  />]]></description>
<pubDate>Sun, 22 Jun 2008 06:41:23 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[hi rahul,<br />from ur post i feel u r not getting any problem with ur compiling but the problem lies in ur programmer hardware.<br />check first if it reads/writes correctly. the best way to do this is to first do simple tasks like erasing the chip/reading fuse bits and try modifying the fuse byte and writing them back to the controller.If u r modifying the fuse bytes to check communication just take care that the CLKSEL fuse bits are not changed.<br />I fu r unable to write the modified fuse bits, then check ur programmer hardware as it may be faulty.<br /><br />If u dont get it, try this simplest  programmer ( as suggested by BIBIN JOHN):<br />The programmer hardware:<br />Printer port connections(25 pin)  --------------- AVR connections ( ATmega 16)<br /><br /> ---------- pin 7     ----------------------------------   Reset (pin 9)   <br /> ---------- pin 8     ----------------------------------   SCK (pin 8)<br /> ---------- pin 9    ----------------------------------- MOSI (pin 6)<br /> ---------- pin 10  -----------------------------------  MISO (pin 7) <br /> ----------pin 18 -21--------------------------------- GND  (pin 11)<br /><br />U have to connect an external power supply of +5V  to VCC and GND of the IC.<br />Connect all the printer port connections to the IC (except GND) via a small (~100 ohms) resistor to prevent damage to the IC in case the PC produces any transient spikes. That takes care of the hardware. Now just download and install  Ponyprog  from the following link:<br />http://www.lancos.com/ppwin95.html<br />and in that in the menu setup/interface setup set the interface to parallel/AVR ISP i/o.<br />that will do the trick and u will get a temporary AVR isp programmer up and running in no time. For long term use, u can add a buffer in between the port and the uC as shown in the site.<br />In the end, read this tutorial :<br />http://www.8051projects.net/avr-microcontroller-tutorial.html<br />It will give u an idea about how to program using ponyprog.<br /><br /><br /><br /><br /><br /><br />]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Sun, 22 Jun 2008 10:56:12 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[spi flash programmer detects the correct mc and also it erases the memory of microcontroller.]]></description>
<author>rahuljin&lt;friend.rahul@nospam.com&gt;</author>
<pubDate>Sun, 22 Jun 2008 13:16:30 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[try using AVR Studio along with WinAVR (it will detect automatically) to get hex file.. <br /><br />I am just assuming that you have configured the makefile properly <img src='http://www.8051projects.net/e107_images/emotes/yahoo/17.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />try my suggestion once.. then i will look into your make file <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>Ajay&lt;contact@nospam.com&gt;</author>
<pubDate>Mon, 23 Jun 2008 08:35:20 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[i dont know what of avr programmer i have (stk200, 300, 500, etc.).<br /><br />is there anyway to detect it ??<br /><br />i am using the parallel port for ptogramming atmega16L.]]></description>
<author>rahuljin&lt;friend.rahul@nospam.com&gt;</author>
<pubDate>Mon, 23 Jun 2008 10:27:34 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[I still feel u try using the hardware i earlier suggested . After all it requires only four resistors and a printer cable and works perfectly well ( my personal experience!). Actually, the hardware used for spi flash programmer 3.7 is a bit more complicated and there is a chance for a wrong connection .]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Mon, 23 Jun 2008 10:44:15 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[stk200 is common for most of atmega series.<br />If you have checked internet and on website tutorial, you will find people talking about STK200 only <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />I would recommend you to use STK200 programmer (safe for Parallel port).]]></description>
<author>Ajay&lt;contact@nospam.com&gt;</author>
<pubDate>Tue, 24 Jun 2008 08:14:26 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[here is the schematic for STK200.<br /> <img src='http://www.8051projects.net/e107_images/newspost_images/' class='bbcode' alt=''  />	<br /><a class='bbcode' href='http://www.8051projects.net/e107_files/public/1214367454_1329_FT10215_stk200.png' rel='external'  target='_blank'><img src='http://www.8051projects.net/e107_files/public/1214367454_1329_FT10215_stk200_.png' class='bbcode' alt='' width='500' height='421'  />	</a><br />]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Tue, 24 Jun 2008 21:17:34 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[thanks !!! there was a problem in hardware.<br /><br />i made a new programmer -----<br /><br />http://gopchandani.wordpress.com/2007/01/18/the-atmega32-programmer<br /><br />it works great with ponyprog but i want to ask that can i use it with winavr or avr studio ? i mean i want to program using these software.<br /><br />also, buffer is necessary or not ? what is its effect ?]]></description>
<author>rahuljin&lt;friend.rahul@nospam.com&gt;</author>
<pubDate>Sat, 28 Jun 2008 09:47:15 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[yes you can use it with winavr (used and tested) and avr studio directly.. never tried it..]]></description>
<author>Ajay&lt;contact@nospam.com&gt;</author>
<pubDate>Mon, 30 Jun 2008 06:49:33 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[used and tested ??? how ??<br /><br />i made the programmer without buffer chip. is it ok ??]]></description>
<author>rahuljin&lt;friend.rahul@nospam.com&gt;</author>
<pubDate>Mon, 30 Jun 2008 09:19:53 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[thanks. one last think i want to ask. i get this circuit for test board, but it is active low. what is mean by active low and how i can make it active high. when i try to run a simple led program, opposite things happen. i programmer for 1 led to get on but other seven get ON and that one turns off.<br /><br /><br /><img src='http://www.8051projects.net/e107_files/public/1214852873_3897_FT10215_7777.jpg' class='bbcode' alt='' width='378' height='432'  />]]></description>
<author>rahuljin&lt;friend.rahul@nospam.com&gt;</author>
<pubDate>Mon, 30 Jun 2008 12:07:53 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[hi rahul,<br />the programmer without the buffer is o.k. but not safe as far as long term is concerned.<br />As far as the AVRstudio programmer is concerned, the hardware seems to be the same for the AVRISP programmer. Just go to Tools ->Program AVR -> connect   and select 'STK500 or AVRISP' , the com port u have connected ur programmer and press 'connect'.<br /><br />P.S. i personally use the ponyprog and have not tried the AVRstudio to program it.(as yet) <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Mon, 30 Jun 2008 11:37:05 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[<img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' /> . I did not understand what u men when u said that the <span class='bbcode underline' style='text-decoration:underline'>circuit</span> was active low.maybe u meant the reset was active low. this means that the reset is asserted when a low signal (0v) is given to that pin.Similarly, the reset of 89xx uC is active high. hope u got the idea. <br /><br /> well,about the LED problem, i think  u have connected the anode of LED to  Vcc and the cathode to the port pin, right?.just connect the anode to the port pin and the cathode to ground and u will get the right output. <br />]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Mon, 30 Jun 2008 12:23:27 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[thanks. i get it now. the pins r in opposite direction so opposite output. i will correct it. so thats it for now and for this thread.]]></description>
<author>rahuljin&lt;friend.rahul@nospam.com&gt;</author>
<pubDate>Mon, 30 Jun 2008 19:28:58 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[i have a new problem. i added the resistor and capacitor(for reset) in the programmer so that i can test my codes in programmer without removing microcontroller, now it is not working. what if i dont use the capacitor ?<br />and how to use external oscillator ? i hav a 8 mhz crystal oscillator.]]></description>
<author>rahuljin&lt;friend.rahul@nospam.com&gt;</author>
<pubDate>Sat, 05 Jul 2008 07:16:24 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[hi rahul,<br />check ur reset pin if if is being pulled low by the programmer hardware. better remove the programmer connection from the reset pin and check the circuit. the circuit shown by u in the previous post seems to be perfectly alright except just try reducing the reset resistor value to say 10k instead of 100k  aand capacitor to 10u  instead of 0.1u.. <br />as for ur second doubt, u can change the oscillator mode by changing the cksel fuses of the microcontroller. If u r using ponyprog, first read the fuses, then modify them acordingly and then write the modified value.<br /> here is the screen shot of the fuse bit programming box of ponyprog:(click the button circled to bring up this box.<br /> <img src='http://www.8051projects.net/e107_images/newspost_images/' class='bbcode' alt=''  />	 <br /><br /><a class='bbcode' href='http://www.8051projects.net/e107_files/public/1215274136_1329_FT10215_fusebytes.jpg' rel='external'  target='_blank'><img src='http://www.8051projects.net/e107_files/public/1215274136_1329_FT10215_fusebytes_.jpg' class='bbcode' alt='' width='500' height='281'  />	</a><br />]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Sat, 05 Jul 2008 09:08:56 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[here is the fuse selection table for external crystal connection for various frequencies:<br /> <img src='http://www.8051projects.net/e107_images/newspost_images/' class='bbcode' alt=''  />	<br /><a class='bbcode' href='http://www.8051projects.net/e107_files/public/1215274562_1329_FT10215_fuse_stting.jpg' rel='external'  target='_blank'><img src='http://www.8051projects.net/e107_files/public/1215274562_1329_FT10215_fuse_stting_.jpg' class='bbcode' alt='' width='500' height='281'  />	</a><br />]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Sat, 05 Jul 2008 09:16:02 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[ground and reset r shorted. is it correct ??<br /><br />can i just put the oscillator in programmer but use the internal oscillator ?]]></description>
<author>rahuljin&lt;friend.rahul@nospam.com&gt;</author>
<pubDate>Sat, 05 Jul 2008 10:29:35 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
						<item>
						<title>Re: problem in programming atmega 16L</title>
<link>http://www.8051projects.net/forum-t10215.html</link>
<description><![CDATA[<img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' />  <br />reset is not shorted to gnd. it is connected to gnd via a reset capacitor.<br /><br />o.k......... yes, that is the mistake in ur previous circuit.remove the short between the reset and gnd. that would certainly reset the uC continuosly.<br /><br />and yes, u can physically connect the crystal to the uC but still use the internal oscillator.]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Sat, 05 Jul 2008 10:44:26 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10215.html</guid>
</item>
				</channel>
				</rss>