Embedded C
Embedded C
ATmega16 is a lowpower CMOS 8-bit microcontroller based on the AVR RISC architecture.
By executing powerful instructions in a single clock cycle, the ATmega16 achieves throughput 6/11/12 approaching 1 MIPS
Contd....
In order to maximize performance and parallelism, the AVR uses a Harvard architecture- which separates memories and buses for program and data. Instruction in program memory are executed with single level pipelining. This concept enables instructions to be executed in every clock cycle.
6/11/12
FEATURES
High-performance, Low-power 8-bit Microcontroller. Up to 16 MIPS Throughput at 16 MHz. 32 x 8 General Purpose Working Registers. 3 PWM Channels. Internal Calibrated RC Oscillator. External and Internal Interrupt Sources.
6/11/12
MEMORY SEGMENTS
High Endurance Non-volatile Memory segments. 8K Bytes of In-System Self-programmable Flash program memory. 512 Bytes EEPROM (Electrically Erasable Programmable Read Only Memory). 1K Byte Internal SRAM (Static Random Access Memory).
6/11/12
PIN OUTS
6/11/12
EMBEDDED SYSTEM
An Embedded system is combination of computer hardware and software, and perhaps additional mechanical or others parts, designed to perform a specific task. Example: microwave oven, AC etc
6/11/12
INTRODUCTION TO EMBEDDED C
Development process of AVR projects Control structures in C Algorithms to be studied AVR studio
6/11/12
WHAT IS EMBEDDED C?
Embedded C is nothing but a subset of C language which is compatible with certain microcontrollers. Some features are added using header files like <avr/io.h>, <util/delay.h>. scanf() and printf() are removed as the inputs are scanned from the sensors and outputs are given to the ports. Control structures remain the same like ifstatement, for loop, do-while etc. 6/11/12
Write C programs in AVR Studio. Compile them into a .hex file using the AVRGCC compiler (which integrates into AVR Studio). Simulate the target AVR program and debug the code within AVR Studio. Program the actual chip using the AVRISP mkII USB device, which is attached to our target board with a special 6-pin cable.
6/11/12
IF- STATEMENT
6/11/12
6/11/12
Blinking LED Line follower robot Edge avoider robot Light searching robot
6/11/12
BLINKING LED
Program: main() { DDRB=0XFF; while(1) { PORTB=0XFF; _delay_ms(255); 6/11/12
Left_sensor=PINC&0b0010000, i.e.. Masking PC4 bit of PORT C Right_sensor=PINC&0b0100000, i.e.. 6/11/12 Masking PC5 bit of PORT C
Left_sensor=PINC&0b0010000, i.e.. Masking PC4 bit of PORT C Right_sensor=PINC&0b0100000, i.e.. Masking PC5 bit of PORT C
Step 5: condition 1: if(left_sensor= off and right_sensor=off) move backward, and after some delay move right Step 6: condition 2: if(left_sensor= on and right_sensor=on) move forward. Step 7: condition 3: if(left_sensor= off and right_sensor=on) move backward, and after some delay move right
6/11/12
DELEVOPMENT TOOLS
HOME SCREEN FOR OF AVR STUDIO
6/11/12
6/11/12
6/11/12
6/11/12
CODING WINDOW
6/11/12
6/11/12
6/11/12
THANK YOU
Click to edit Master subtitle style
6/11/12