NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Led Blink
October 05, 2011 by rajdua |
I am trying to make led blink with ATMega168 controller. Why do we need led_blink.hex and led_blink.o files? Do I have to make .hex and .o files for every program?? How to make .hex and .o files??? Also, can anyone provide me with C programming tutorial for ATMega168 and tutorial for "Make" file. |
---|---|
October 05, 2011 by rajdua |
Forget to add: What is difference between these too-> DDRC |= (1<<PC4); and PORTC |= (1<<PC4); |
October 05, 2011 by Ralphxyz |
well rajdua the best answer is to suggest you read the specsheet!
Obviously they are two different things. PortC is a data register while DDRC is a Data Direction Register. Now re: Why do we need led_blink.hex and led_blink.o files? Well what else would you like to do? A MCU does not understand a C file so it seems as if making a file the MCU understands would be a good idea. This is from http://imakeprojects.com/Projects/avr-tutorial/ [quote] A successful compile will result in a .hex file being generated. This is the binary code in a format ready to be burned into your AVR chip by the programmer. [/quote] The .o file is the compilers interpretation of the .hex code instructions, so yes both are required. re: How to make .hex and .o files??? Type make from a command line!! Of course you need the AVR-gcc compiler installed. re: Also, can anyone provide me with C programming tutorial for ATMega168 and tutorial for "Make" file. Google AVR programing and Make If you have nothing better to do for the rest of your life you can always start here. Ralph |
Please log in to post a reply.
Did you know that you can make a spooky Halloween Jack-O-Lantern with a microcontroller? Learn more...
|