Microcontrollers MCS51 and AVR - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Microcontrollers MCS51 and AVR

Description:

Family of RISC microcontrollers from Atmel (reduced instruction set computer, ... Watchdog Timer (WDT) Siemens Program and System Engineering S.R.L.. 14. PSE. ... – PowerPoint PPT presentation

Number of Views:195
Avg rating:3.0/5.0
Slides: 22
Provided by: ro1v
Category:

less

Transcript and Presenter's Notes

Title: Microcontrollers MCS51 and AVR


1
MicrocontrollersMCS51 and AVR
Degree of confidentiality
2
PCs and Microcontrollers
  • Personal Computer
  • Keyboard, monitor, CPU, printer, mouse
  • Communicate (interface) with humans
  • Microcontrollers
  • Micro because theyre small
  • Controller because they control machines,
    gadgets, instruments, etc.
  • Integrated circuit
  • Contains many of the same items that a desktop PC
    has CPU, memory, interfaces etc.
  • Not include any human interface
  • Designed for machine control applications, rather
    than human interaction

3
Microcontrollers
  • A microcontroller is a computer-on-a-chip, or, a
    single-chip computer
  • Primarily, the microcontroller is capable of
    storing and running a program
  • Contains
  • CPU
  • RAM/ROM
  • I/O lines
  • serial and parallel ports
  • timers
  • other built-in peripherals such as A/D and D/A
    converters

4
MCS51
  • 8051, developed by Intel in 1980
  • Harvard architecture single chip microcontroller
    (physically separate storage and signal pathways
    for their instructions and data )
  • Typically contains
  • Processor (CPU). The original 8051 core ran at 12
    clock cycles per machine cycle, with most
    instructions executing in one or two machine
    cycles
  • 8 bit data bus. Can access 8 bit data in one
    operation
  • 16 bit address bus. Can access 64 KB of memory
    each of RAM and ROM
  • On chip RAM - 128 or 256 bytes Bytes (Data
    Memory)
  • On chip Program Memory - 512 bytes to 128kb
  • Four Bit bi-directional Input Output port
  • One or two Serial Ports (UARTs)
  • Two or three timers
  • Two level interrupt priority
  • Power saving mode

5
MCS51
  • Common features included in modern 8051 based
    microcontrollers
  • built-in reset timers with brown-out detection
  • on-chip oscillators
  • self-programmable Flash ROM program memory
  • bootloader code in ROM
  • EEPROM non-volatile data storage
  • I2C, SPI, and USB host interfaces
  • PWM generators, analog comparators, A/D and D/A
    converters
  • RTCs, extra counters and timers
  • in-circuit debugging facilities
  • more interrupt sources
  • extra power saving modes
  • Several C compilers are available for the 8051
  • Other high level languages such as Forth, BASIC,
    PASCAL, PL/M and Modula 2 are available
  • Single cycle 8051 cores, in the range 130 MHz to
    150 MHz, are now available in internet
    downloadable form for use in programmable logic
    devices such as FPGAs and at many hundreds of MHz
    in ASICs

6
Atmel 8051 architecture
7
Arithmetic Instructions
  • For example, the ADD A, ltbytegt instruction can be
    written as
  • ADD A,7FH (direct addressing)
  • ADD A,_at_ R0(indirect addressing)
  • ADD A,R7 (register addressing)
  • ADD A, 127(immediate constant)

8
Data Transfers and Boolean Instructions
9
Programming example
bseg at 0 at bit 0 cseg at 0 jmp main
org 23h jmp isr_serial isr_serial
serial handler jb ri,receptie clr p3.7
set RX on 485 clr ti end_trs jb ri,receptie
reti receptie
receive handler clr ri mov a,sbuf jb
at,readaddr cjne a,65,noatent jmp atention
-------------- read address ------------------
readaddr cjne a,2,nodevice mov r7,30 wtt0
mov r6,255 wtt1 djnz r6,wtt1
djnz r7,wtt0 mov a,p1 setb p3.7 mov sbuf,
a nodevice clr at reti noatent
reti
10
Programming example
-------------- set atention flag
--------------- atention setb at reti main
mov r0,7fh clear mov _at_r0,0 djnz r0,c
lear clear memory mov sp,70h set
stack pointer clr p3.7 set RX on
485 call ini call init loop wait for
events jmp loop ------------------- serial
initialization --------- ini mov scon,5ch
mov tmod,20h mov th1,0fdh mov pcon,80h
setb tr1 mov ie,90h ret end
11
ADuC microcontroller
12
AVR
  • Family of RISC microcontrollers from Atmel
    (reduced instruction set computer, favors a
    simpler set of instructions that all take about
    the same amount of time to execute)
  • Program instructions are stored in semi-permanent
    Flash memory which loads and manipulates data in
    the volatile SRAM
  • The AVRs have thirty-two single-byte registers.
  • Two-stage pipeline design
  • Most instructions take just one or two clock
    cycles
  • The AVRs were designed for the efficient
    execution of compiled C code

13
AVRs features
  • RISC Core Running Many Single-Cycle Instructions
  • Multifunction, Bi-directional I/O Ports with
    Internal, Configurable Pull-up Resistors
  • Internal Oscillators
  • Internal Instruction Flash Memory up to 256K
  • Internal Data EEPROM up to 4KB
  • Internal SRAM up to 8K
  • 8-Bit and 16-Bit Timers
  • PWM Channels
  • Dedicated I2C Compatible Two-Wire Interface
  • Synchronous/Asynchronous Serial Peripherals
    (UART/USART)
  • Serial Peripheral Interface (SPI)
  • Analog Comparators
  • 10-Bit A/D Converters
  • Brownout Detection
  • Watchdog Timer (WDT)

14
AVRs features
  • Low-voltage Devices Operating Down to 1.8v
  • Universial Serial Interface for Two-Wire,
    Three-Wire Synchronous Data Transfer
  • picoPower Devices
  • CAN Controller Support
  • Lighting (PWM Specific) Devices
  • USB Controller Support
  • LCD Controller Support
  • Ethernet Controller Support
  • Multiple Power-Saving Sleep Modes

15
AVR Architecture
16
AVR Instructions
17
GeMASYS
18
Domocontroller
19
Energy monitoring
Second card
First card
20
Other embedeed systemsGumstix
21
References
  • www.atmel.com
  • http//microcontroller.com/
  • http//www.8052.com/tut8051.phtml
  • http//www.avrfreaks.net/
  • http//winavr.sourceforge.net/
  • http//avr.15.forumer.com/index.php?showforum10
  • http//sdcc.sourceforge.net/
  • https//gumstix.com/index.html
Write a Comment
User Comments (0)
About PowerShow.com