Presentation is loading. Please wait.

Presentation is loading. Please wait.

Vadodara Institute of Engineering Subject: Microcontroller interfacing Prepared by: Bipin Malani (130800111002) Vishwa Pandit (130800111003) Branch : Electronics.

Similar presentations


Presentation on theme: "Vadodara Institute of Engineering Subject: Microcontroller interfacing Prepared by: Bipin Malani (130800111002) Vishwa Pandit (130800111003) Branch : Electronics."— Presentation transcript:

1 Vadodara Institute of Engineering Subject: Microcontroller interfacing Prepared by: Bipin Malani (130800111002) Vishwa Pandit (130800111003) Branch : Electronics & communication Guided by: Prof. Isha Gautam Prof. Satish Bhati

2 Active learning assignment on Introduction of Microcontroller 330_012

3 Contents Introduction Software using for microcontroller Embedded system Difference between microcontroller and microprocessor Architecture of AVR microcontroller AVR register References 3

4 Microcontrollers Embedded Systems – Operations managed behind the scenes by a microcontroller Microcontroller (MCU) – Integrated electronic computing device that includes three major components on a single chip Microprocessor (MPU) Memory I/O (Input/Output) ports

5 Microcontrollers Support Devices – Timers – A/D converter – Serial I/O Common communication lines – System Bus

6 Software Machine Language – Binary Instructions – Difficult to decipher and write Error-prone – All programs converted into machine language for execution InstructionHexMnemonicDescriptionProcessor 1000000080ADD BAdd reg B to AccIntel 8085 0010100028ADD A, R0Add Reg R0 to AccIntel 8051 000110111BABAAdd Acc A and BMotorola 6811

7 Embedded Systems Normal everyday items contain computer chips, complete with CPU, memory, programs – Television, Entt. Center, Automobiles, Irrigation, – MP3, cell phones, GPS, – microwave, home alarms, thermostats, – network routers, game consoles Special purpose machines contain computers – Manufacturing, metering, sensing, – ATM machines, kiosks – Medical Instruments, Aircraft, Satellites,

8 Embedded Systems A “special purpose” unit – e.g. simple cell phone (it does not run MS-Word) Has a CPU, memory and programs that control mainly physical things – The program is preinstalled and cannot be changed easily Has limited processing power and limited electrical power and limited data storage Has “intelligence” – Can be configured, personalized, “programmed”

9 Difference between microcontroller and microprocessor 330_019

10 Architecture of AVR microcontroller 330_0110

11 Continues… Flash Memory: It is an electronic non-volatile computer storage medium that can be electrically erased and reprogrammed. Introduced by Toshiba in 1984, flash memory was developed from EEPROM (electrically erasable programmable read- only memory). Instruction register: In computing, an instruction register (IR) is the part of a CPU's control unit that stores the instruction currently being executed or decoded.

12 Continues.. Instruction Decoder : The Instruction Decoder reads the next instruction in from memory, and sends the component pieces of that instruction to the necessary destinations. Program Counter: A program counter is a register in a computer processor that contains the address (location) of the instruction being executed at the current time. As each instruction gets fetched, the program counter increases its stored value by 1.

13 Continues.. Status and control: status is one type of register, it is also called as flag register. It contains H, V, S, N, C, Z flags. - H flag: Half flag - V flag: Overflow flag - S flag: sign flag - N flag: Negative flag - C flag: Carry flag - Z flag: Zero flag

14 Continues.. General purpose register: There are 32 general- purpose 8-bit registers, R0–R31. All arithmetic and logic operations operate on those registers; only load and store instructions access RAM. A limited number of instructions operate on 16-bit register pairs.

15 Continues..

16 ALU: All the arithmetical operation like, addition, subtraction, multiplication, ORing, ANDing,etc. of AVR are done by this unit. SRAM : SRAM (static RAM) is random access memory that retains data bits in its memory as long as power is being supplied. EEROM: EEPROM (also written E 2 PROM and pronounced "e- e-prom", "double-e prom", "e-squared", or simply "e-prom") stands for Electrically Erasable Programmable Read- Only Memory and is a type of used in computers and other electronic devices to store small amounts of data that must be saved when power is removed

17 Continues.. Watch dog timer: It is a timing devise which is set for a preset time interval & an event occur during that time interval. - it is used to find fault of software automatically and restart the processor.

18 AVR registers: All information in the microcontroller, from the program memory, the timer information, to the state on any of input or output pins, is stored in registers. Registers are like shelves in the bookshelf of processor memory. In an 8-bit processor, like the AVR ATMega 16 we are using, the shelf can hold 8 books, where each book is a one bit binary number, a 0 or 1. Each shelf has an address in memory, so that the controller knows where to find it. The 32 IO pins of the ATMega16 are divided into 4 ports, A, B, C, and D. Each port has 3 associated registers. For example, for port D, these registers are referred to in C-language by PORTD, PIND, and DDRD. For port B, these would be PORTB, PINB, and DDRB, etc. In C- language, PORTD is really a macro, which refers to a number that is the address of the register in the AVR, but it is much easier to remember PORTD than some arbitray hexadecimal number.

19

20

21

22

23

24 AVR general purpose registers:

25 AVR status registers:

26 Bit 0 – C: Carry Flag: The Carry Flag C indicates a carry in an arithmetic or logic operation. See the "Instruction Set Description" for detailed information. Bit 1 – Z: Zero Flag: The Zero Flag Z indicates a zero result in an arithmetic or logic operation. See the "Instruction Set Description" for detailed information.

27 Bit 2 – N: Negative Flag The Negative Flag N indicates a negative result in an arithmetic or logic operation. See the "Instruction Set Description" for detailed information. Bit 3 – V: Two's Complement Overflow Flag The Two's Complement Overflow Flag V supports two's complement arithmetics. See the "Instruction Set Description" for detailed information.

28 Bit 4 – S: Sign Bit: S = N, V :The S-bit is always an exclusive or between the negative flag N and the two's complement overflow flag V. See the "Instruction Set Description" for detailed information. Bit 5 – H: Half Carry Flag: The Half Carry Flag H indicates a half carry in some arithmetic operations. Half carry is useful in BCD arithmetic. See the "Instruction Set Description" for detailed information.

29 Bit 6 – T: Bit Copy Storage The Bit Copy instructions BLD (Bit LoaD) and BST (Bit STore) use the T-bit as source or destination for the operated bit. A bit from a register in the Register file can be copied into T by the BST instruction, and a bit in T can be copied into a bit in a register in the Register file by the BLD instruction.

30 Bit 7 – I: Global Interrupt Enable :The Global Interrupt Enable bit must be set for the interrupts to be enabled. The individual interrupt enable control is then performed in separate control registers. If the Global Interrupt Enable Register is cleared, none of the interrupts are enabled independent of the individual interrupt enable settings. The I-bit is cleared by hardware after an interrupt has occurred, and is set by the RETI instruction to enable subsequent interrupts. The I-bit can also be set and cleared in software with the SEI and CLI instructions, as described in the instruction set reference.

31 References http://www.zembedded.com/avr-registers- explained/ http://www.zembedded.com/avr-registers- explained/ https://in.images.search.yahoo.com/search/i mages;_ylt=A2oKmLkgpBZWMlkAPU67HAx.;_ ylu=X3oDMTEzM3Nrc2x0BGNvbG8Dc2czBHBv cwMxBHZ0aWQDSU5DMDAxXzEEc2VjA3Nj?p =Avr+Registers&fr=spigot-yhp-ff https://in.images.search.yahoo.com/search/i mages;_ylt=A2oKmLkgpBZWMlkAPU67HAx.;_ ylu=X3oDMTEzM3Nrc2x0BGNvbG8Dc2czBHBv cwMxBHZ0aWQDSU5DMDAxXzEEc2VjA3Nj?p =Avr+Registers&fr=spigot-yhp-ff

32


Download ppt "Vadodara Institute of Engineering Subject: Microcontroller interfacing Prepared by: Bipin Malani (130800111002) Vishwa Pandit (130800111003) Branch : Electronics."

Similar presentations


Ads by Google