Seminar

973 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
973
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
118
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • DATA SHEET PAGE 23
  • Seminar

    1. 1. BY - SAYAK CHOUDHURY BRANCH - EEE ROLL No. 1007160
    2. 2. MAIN FEATURES  High-performance, Low-power , 8-bit Microcontroller  Advanced RISC Architecture  131 Powerful Instructions – Most Single-clock Cycle Execution  32 x 8 General Purpose Working Registers  Fully Static Operation  Nonvolatile Program and Data Memories  16K Bytes of In-System Self-Programmable Flash  Endurance: 10,000 Write/Erase Cycles  True Read-While-Write Operation  512 Bytes EEPROM  1K Byte Internal SRAM  On-chip Analog Comparator  Programming Lock for Software Security  JTAG (IEEE std. 1149.1 Compliant) Interface  Boundary-scan Capabilities According to the JTAG Standard  Extensive On-chip Debug Support  Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface
    3. 3. MAIN FEATURES CONTD…  Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes  One 16-bit Timer/Counter with Separate Prescaler & Compare Mode  Real Time Counter with Separate Oscillator  Four PWM Channels  8-channel, 10-bit ADC  2 Differential Channels with Programmable Gain at 1x, 10x, or 200x  Byte-oriented Two-wire Serial Interface  Programmable Serial USART  Master/Slave Serial Interface  Power-on Reset  Internal Calibrated RC Oscillator  External and Internal Interrupt Sources  Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended Standby  40-pin PDIP, 44-lead TQFP, and 44-pad MLF Package  Operating Voltage 4.5 - 5.5V  Speed Grades 0 - 16 MHz
    4. 4. PIN CONFIGURATION
    5. 5. ATMEGA 16 DATASHEET DATA SHEET Now the most important part of Atmega 16 How to use Atmega 16 microcontroller in embedded system? What is embedded system? Why embedded system used? Where embedded systems are used?
    6. 6. HARDWARE AND SOFTWARE REQUIRED  Hardware: 1.Atmega16 microcontroller 2.IC 7805 3.USB AVR programmer 4.Other interfacing devices  Software: 1.Win AVR 2.AVR Studio 4
    7. 7. HOW TO WRITE ON A BIT OR READ FROM BIT    Set the bit PX0 as input or output by DDRX|=(1<<0) to set PX0 as output and DDRX&=~(1<<0) to set PX0 as input pin Write something on the bit PX0 by PORTX|=(1<<0) to write 1 on PX0 PORTX&=~(1<<0) to write 0 on PX0 Read from the bit PX0 by Unsigned int h; h=PINX; h&=(1<<0); Then h will be the data present in the PX0 pin.
    8. 8. HOW TO SET AND RESET A BIT Suppose we have to set PX0 then write  PORTX |=(1<<0) or PORTX|=_BV(PX0) PORTX=0bddddddd1 or PORTX = 1  PORTX=0xd1 or Now suppose we have to reset PX0 then write  PORTX &=~(1<<0) or PORTX&=~(_BV(PX0)) PORTX= 0xd0 or PORTX=0bddddddd0 or PORTX = 0  Here ‘d ‘ denotes the don’t care  First 2 ways are convenient because the other bits are not affected by this way 
    9. 9. HOW TO TOGGLE A BIT       Now suppose we have to toggle PB0 with a delay of 500ms Put a delay header file by #include<util/delay.h> PORTB =^(1<<0) ;_delay_ms(500); or PORTB=^(_BV(PB0)) ;_delay_ms(500);or PORTB=0xd1;_delay_ms(500); PORTB=0xd0;_delay_ms(500);or PORTB=0bddddddd1; _delay_ms(500); PORTB=0bddddddd0; _delay_ms(500);or PORTB=1; _delay_ms(500); PORTB=0;_delay_ms(500); Here also the first two ways are convenient because of the same reason.
    10. 10. EEPROM  Code to write data to EEPROM Void write(unsigned int add,unsigned char data) { wait(); while(EECR&(1<<EEWE)); EEAR=add; EEDR=data; EECR|=(1<<EEMWE); EECR|=(1<<EEWE); }  Code to read data from EEPROM Unsigned char read(unsigned int add) { wait(); while(EECR&(1<<EEWE)); EEAR=add; EECR|=(1<<EERE); return EEDR; }
    11. 11. SUT is used to control the frequency at low frequency CKSEL =1 to 4 CKSEL = 5 to 8 CKSEL = 0 CKSEL = A CKSEL=9
    12. 12. MODES AND POWER MANAGEMENT MCUCR is the register responsible for determining the mode of operation.
    13. 13. SYSTEM CONTROL & RESET POWER ON RESET 2. EXTERNAL RESET 3. BROWN OUT DETECTION Typical time out of WDT for 5V VCC is 4. WATCHDOG RESET 16.3ms to 2.1sec 5. JTAG RESET MCUCSR register defines the reset condition and cause of reset Watchdog timer control register(WDTCR) 1. -------- -------- -------- WDTOE WDE WDP2 WDP1 WDP0
    14. 14. USART
    15. 15. USART CONTD…
    16. 16. USART CONTD… PROGRAMMING CONCEPT #include <avr/io.h> #include <inttypes.h> void USARTInit(uint16_t ubrr_value){ UBRRL = ubrr_value; UBRRH = (ubrr_value>>8); UCSRC=(1<<URSEL)|(3<<UCSZ0); UCSRB=(1<<RXEN)|(1<<TXEN);} char USARTReadChar(){ while(!(UCSRA & (1<<RXC))){} return UDR;} void USARTWriteChar(char data){ while(!(UCSRA & (1<<UDRE))){} UDR=data;} This function is used to set baud rate and initialize the USART communication This function is used to read data from RXD pin This function is used to write data to TXD pin
    17. 17. USART CONTD… void main() { char data; USARTInit(103); //UBRR = 103 while(1) { DDRB=0xFF; data=USARTReadChar(); PORTB=data; }; Return 0; }  One more thing windows hyperterminal is required, where we have to put the communication port number and baud rate taking the data from device manager of the PC after connecting ATMEGA16
    18. 18. TWO WIRE INTERFACE(TWI)  This is the interconnection of one AVR microcontroller with several AVR microcontrollers. ……. DEVICE 1 DEVICE 2 DEVICE 3 DEVICE 4 DEVICE n SDA SCL
    19. 19. JTAG
    20. 20. JTAG CONTD…  The JTAGEN fuse must be programmed and the JTD bit in the MCUSR Register must be cleared to enable the JTAG Test Access Port.  The JTAG programming capability supports: 1. Flash programming and verifying 2. EEPROM programming and verifying 3. Fuse programming and verifying 4. Lock bit programming and verifying Now, What is boundary scan? Why we have to use JTAG? What is device identification register?
    21. 21. REST OF THE TOPICS CAN BE VISUALIZED BY PROTEUS8.0 SOFTWARE THAT’S WHY EXPLAINED BY DEMO OF SOME PROJECTS The topics are: 1. TIMER /COUNTER 2. PULSE WIDTH MODULATION 3. ANALOG TO DIGITAL CONVERSION 4. COMPARATOR 5. USART 6. LCD INTERFACE 7. KEYBOARD INTERFACE 8. MOTOR INTERFACE
    22. 22. SOME INTERESTING PROJECTS 1.LED traffic control with ATMEGA16 simple code 2.Analog comparator and LED glow
    23. 23. SOME INTERESTING PROJECTS CONTD... 3.Temperature display using Interrupt, ADC and LCD interface 4.USART communication using hyperterminal to see the ASCII value of any character
    24. 24. SOME INTERESTING PROJECTS CONTD... 5.Line follower Robot using ADC, Motor interface, PWM and timer/counter and LCD interface 6.Password protected door lock system using keyboard interface, motor interface and LCD interface
    25. 25. THANK YOU

    ×