8051 microcontroller: Internals, Instructions, Programming and Interfacing by Subrata Ghoshal. Microcontrollers which were developed after the development of 8051.
8051 microcontroller: Internals, Instructions, Programming and Interfacing by Subrata Ghoshal. Microcontrollers which were developed after the development of 8051.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online from Scribd
8051 microcontroller: Internals, Instructions, Programming and Interfacing by Subrata Ghoshal. Microcontrollers which were developed after the development of 8051.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online from Scribd
were developed after the development of 8051. We shall confine our discussions within: • 8-bit microcontroller – Atmel AVR (ATmega8) • 16-bit microcontroller – Intel MCS-96 • 32-bit microcontroller – ARM microcontroller
• Introduction of Flash memory for program storage. • Advanced RISC microcontrollers with Harvard Architecture. • ATmega8 and ATmega16 are two popular versions, apart from TINY and XMEGA versions of AVR. 8051 Microcontroller: Internals, Instructions, 03 OF 35 Programming and Interfacing by Subrata Ghoshal Some Important Features of ATmega8 • 8-bit advanced RISC architecture.
• Register to register architecture without any accumulator. • 130 instructions including signed and unsigned multiplication. • 32 general purpose 8-bit registers. • Fully static to 16 MHz operational frequency. • 8K bytes on-chip flash program memory. • 1K bytes on-chip SRAM for data storage. • 512 bytes on-chip EEPROM. • Programming lock for software security. • 23 programmable I/O lines. 8051 Microcontroller: Internals, Instructions, 04 OF 35 Programming and Interfacing by Subrata Ghoshal Some Important Features of ATmega8 • Two 8-bit and one 16-bit Timers/Counters.
• Six-channel 10-bit on-chip ADC. • Programmable serial USART. • SPI serial interface. • Watchdog timer with separate on-chip oscillator. • On-chip analog comparator. • External and internal interrupt sources. • Five sleep modes for power management.
8051 Microcontroller: Internals, Instructions,
05 OF 35 Programming and Interfacing by Subrata Ghoshal Pins and Signals of ATmega8
I/O lines have alternate functions. • Five power input lines. • External crystal and reset are not essential. 8051 Microcontroller: Internals, Instructions, 06 OF 35 Programming and Interfacing by Subrata Ghoshal Operating Voltage and Power Consumption • Operating voltage of
– ATmega8: 4.5V to 5.5V – ATmega8L: 2.7V to 5.5V • At 4 Mhz with 3 volts it consumes 3.6 mA, reduced to 1 mA in idle mode and 0.5 uA in power-down mode. • Each port pin of ATmega8L is capable of sourcing or sinking 20 mA current at 5V and 10 mA current at 3V. Note the identical sourcing as well as sinking capabilities. 8051 Microcontroller: Internals, Instructions, 07 OF 35 Programming and Interfacing by Subrata Ghoshal Simplified Internal Architecture of ATmega8 • The central feature is the
AVR core consisting ALU, 32 general purpose registers including three index registers, processor status register, stack pointer and program counter with instruction register and instruction decoder. 8051 Microcontroller: Internals, Instructions, 08 OF 35 Programming and Interfacing by Subrata Ghoshal Map of ATmega8 Program Memory (Flash) • Program memory is
arranged as 4K words as ATmega8 opcodes are either 16-bit or 32-bit. • The program memory is divided into two sections : boot and application for software security.
8051 Microcontroller: Internals, Instructions,
09 OF 35 Programming and Interfacing by Subrata Ghoshal Organization of 1120 bytes of SRAM Data Memory • Data memory (SRAM)
accommodates general purpose registers, I/O registers and scratch pad area. • I/O registers are similar to the Special Function Registers (SFRs) of 8051. • I/O registers have two sets of addresses. 8051 Microcontroller: Internals, Instructions, 10 OF 35 Programming and Interfacing by Subrata Ghoshal Details of Status Register (SREG) of ATmega8 • C : carry • S : sign
bytes of SRAM. Lower 96 bytes (register area) must not be occupied by stack. • 16-bit stack pointer contains two 8-bit registers, SPH and SPL. • PUSH command decreases the stack pointer and POP command increases it. • In general, the stack pointer to be initialized by the highest address of SRAM. 8051 Microcontroller: Internals, Instructions, 12 OF 35 Programming and Interfacing by Subrata Ghoshal Power Management and Sleep Modes • ATmega8 offers five sleep modes for efficient power
– Power-on reset – External reset – Watchdog reset, and – Brown-out reset. • All I/O registers are initialized and execution starts from the reset vector. • MCUCSR register holds the information about the source of reset. 8051 Microcontroller: Internals, Instructions, 14 OF 35 Programming and Interfacing by Subrata Ghoshal Watchdog Timer • Operated by a separate internal oscillator of 1 MHz
frequency. • May be enabled or disabled through its register WDTCR. • Generates system reset at terminal count. • Useful to avoid ‘hanging’ system. • To be loaded periodically to avoid system reset.
8051 Microcontroller: Internals, Instructions,
15 OF 35 Programming and Interfacing by Subrata Ghoshal Instruction Set
following five groups: • Arithmetic and logical instructions • Branch instructions • Data transfer instructions • Bit and bit-test instructions, and • MCU control instructions
• Family of 16-bit microcontrollers. • Widely used in printers, modems and hard disc drives. • Have different operating frequencies and offered in various packages. • 8XC196 is discussed as a sample member of the family.
8051 Microcontroller: Internals, Instructions,
18 OF 35 Programming and Interfacing by Subrata Ghoshal Some Important Features of MCS-96 • Following are some of the important features of 8XC196
– Register-to-Register architecture – 16K on-chip ROM/OTPROM – 488 bytes register RAM – Five 8-bit I/O ports – High speed I/O subsystem – Full-Duplex serial port – 16-bit multiply and divide instructions – 8 or 10-bit A/D converter with sample and hold – Four 16-bit software timers – 16-bit up/down counter with capture
8051 Microcontroller: Internals, Instructions,
19 OF 35 Programming and Interfacing by Subrata Ghoshal Some Important Features of MCS-96 – Dynamically configurable 16-bit or 8-bit bus-width
interfacing is allowed through external address, data and control lines. • Pin numbers differ in package type. • MCS-96 designed around Princeton (Von Neumann) architecture. 8051 Microcontroller: Internals, Instructions, 21 OF 35 Programming and Interfacing by Subrata Ghoshal Simplified Internal Architecture of 8XC196
– Arithmetic instructions – Logical instructions – Data transfer instructions – Stack operations – Jump and Call instructions – Conditional jumps – Jump on bit condition – Loop control – Single register instructions – Shift instructions – Special control instructions
• 32-bit architecture • Core is designed by ARM Limited and offered to various manufacturers to add different peripherals. • Extremely efficient in power savings. • Widely used in handsets, iPods, disc drives, etc. • Offers several advanced features for embedded applications.
8051 Microcontroller: Internals, Instructions,
27 OF 35 Programming and Interfacing by Subrata Ghoshal Simplified Schematic of ARM Processor Core • No micro-coding used in the
ARM core. • The barrel shifter performs necessary preprocessing before the register data enters within ALU. • This allows easier calculations of wider ranges of expressions and addresses. 8051 Microcontroller: Internals, Instructions, 28 OF 35 Programming and Interfacing by Subrata Ghoshal Important Features of ARM7TDMI Core • Package type
– 208-pin QFP • Operating frequency – Up to 50 MHz • Operating voltage – 3.3V +/- 5% • Architecture – Fully 16/32-bit RISC architecture – Integrated system for embedded Ethernet application – Cost-effective JTAG-based debug solutions • System manager – 8/16/32-bit external bus support for ROM/SRAM, Flash memory, DRAM and external I/O 8051 Microcontroller: Internals, Instructions, 29 OF 35 Programming and Interfacing by Subrata Ghoshal Important Features of ARM7TDMI Core – One external bus master with bus request/acknowledge pins – Programmable access cycle (0-7 wait cycles)
– Four-word depth write buffer – Cost-effective memory to peripheral DMA interface • Unified instruction/data cache – Two way set associative unified 8K byte cache – Support for LRU protocol – Cache is configurable as an internal SRAM • I2C serial interface – Baud rate generator for serial clock generation • Ethernet controller – DMA engine with burst mode – DMA Tx/Rx buffers – MAC Tx/Rx FIFO buffers 8051 Microcontroller: Internals, Instructions, 30 OF 35 Programming and Interfacing by Subrata Ghoshal Important Features of ARM7TDMI Core – 100/10 Mbit per second operation
– Station management signalling – On-chip CAM – Full-duplex mode with PAUSE feature – Long/short packet modes • High-level Data Link Controls (HDLCs) – HDLC protocol features – Address search mode – Selectable CRC or No CRC mode – Loop back and auto-echo modes – Modem interface – Up to 10 Mbps operation – 2-channel DMA buffer descriptor 8051 Microcontroller: Internals, Instructions, 31 OF 35 Programming and Interfacing by Subrata Ghoshal Important Features of ARM7TDMI Core • DMA controller – 2-channel general DMA
– Initiated by a software or external DMA request – Increments a source or destination address (8, 16 or 32-bit) – 4 data burst mode • UARTs – Two UART blocks with DMA or interrupt based operation – Support for 5, 6, 7 or 8-bit serial data transmit or receive – Programmable baud rates – One or two stop bits – Odd or even parity – Break generation and detection – Parity, overrun and framing error detection – Infra-red Tx/Rx support 8051 Microcontroller: Internals, Instructions, 32 OF 35 Programming and Interfacing by Subrata Ghoshal Important Features of ARM7TDMI Core • Timers – Two programmable 32-bit timers
– Interval mode or toggle mode operation • Programmable I/O – 18 programmable I/O ports – Pins individually configurable • Interrupt controller – 21 interrupt sources including 4 external interrupt sources – Normal or fast interrupt mode – Prioritized interrupt handling • Phase Lock Loop (PLL) – The external clock can be multiplexed by on-chip PLL – Input frequency range is 10-40 MHz – Output frequency is five times of input clock 8051 Microcontroller: Internals, Instructions, 33 OF 35 Programming and Interfacing by Subrata Ghoshal Renesas Family of Microcontrollers