1 / 21

Microcontrollers

Microcontrollers. Embedded Electronic Systems and Microcontrollers. Small- Scale Integration: The 555 Medium-Scale Integration: 4000 Series CMOS Large-Scale Integration: Small Microcontroller. Electronic Dice Example. 1st figure  7400 series logic I C s . A Moore state machine.

sachi
Download Presentation

Microcontrollers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microcontrollers

  2. Embedded Electronic Systemsand Microcontrollers • Small-Scale Integration: The555 • Medium-Scale Integration: 4000 Series CMOS • Large-Scale Integration: Small Microcontroller

  3. Electronic Dice Example • 1st figure 7400 series logic ICs. AMoore state machine. • 2nd figure  An eight-pinmicrocontroller. The economy in components. The microcontroller automatically switches off the LEDsafter a few seconds and enters a low-power mode until the button is pressed again.

  4. Systems • Application-specific integrated circuits (ASICs): Specially designed for a particularapplication as their name implies. They provide the best performance but are extremelyexpensive to design and test. • Field-programmable gate arrays (FPGAs) and programmable logic devices(PLDs): Essentially an array of gates and flip-flops, which can be connected byprogramming the device to produce the desired function. • Microcontrollers: These have nearly fixed hardware built around a central processingunit (CPU). The CPU controls a range of peripherals, which may provide both digitaland analog functions such as timers and analog-to-digital converters.

  5. Small Microcontrollers • A microprocessor needs many other components to support it. These include a(large) external memory and the other. • The trend was therefore to integrate as many functions as possible on to thesame chip as the processor. This gave rise to the microcontroller (MCU or μC), whichtypically contains all of the functions needed to make a complete computer system,including memory.

  6. Anatomy of a Typical Small Microcontroller • Central processing unit: • Arithmetic logic unit (ALU), which performs computation. • Registers needed for the basic operation of the CPU, such as the programcounter (PC), stack pointer (SP), and status register (SR).

  7. Anatomy of a Typical Small Microcontroller • Registers to hold temporary results. • Instruction decoder and other logic to control the CPU, handle resets, andinterrupts, and so on. • Memory for the program: Nonvolatile (read-only memory, ROM). • Memory for data: Known as random-access memory (RAM) usually volatile. • Input/output ports: To provide digital communication with the outside world. • Address and data buses: To link subsystems to transfer data and instructions. • Clock: To keep the whole system synchronized. It may be generated internally orobtained from a crystal or external source.

  8. Anatomy of a Typical Small Microcontroller • The more common peripherals. • Timers: Most microcontrollers have at least one timer. The time at which transitions occur on an input can be recorded. Outputs can be driven on/off automatically at a specified frequency. They provide a regular “tick” that can be used to schedule tasks in a program. • Watchdog timer: This is a safety feature, which resets the processor if the programbecomes stuck in an infinite loop. • Communication interfaces: A wide choice of interfaces is available to exchangeinformation with another IC or system. They include serial peripheral interface (SPI),inter-integrated circuit (I²C or IIC), asynchronous (such as RS-232), universal serial bus(USB), controller area network (CAN), ethernet, and many others. • Nonvolatile memory for data: This is used to store data whose value must be retainedwhen power is removed. Serial numbers for identification and network addresses.

  9. Anatomy of a Typical Small Microcontroller • Analog-to-digital converter: This is very common because so many quantities in thereal world vary continuously. • Digital-to-analog converter: This is much less common, because most analog outputscan be simulated using PWM. • Real-time clock: These are needed in applications that must track the time of day. • Monitor, background debugger, and embedded emulator: These are used todownload the program into the MCU and communicate with a desktop computer duringdevelopment. • The processor communicates with these peripherals by reading from, and writing to,particular addresses in memory. These memory locations are called special functionregisters or peripheral registers to distinguish them from ordinary memories.

  10. Memory • Each location store 1 byte (8 bits or 1B) of data and is oftencalled a register, although this term is sometimes reserved for memories within the CPU. • Memory is linked to the CPU by buses for data, address, and control. Buses are shared sets of wires that join several components. • The number of wires in a bus defines its width, which is the size of data thatcan be processed by the CPU. • For example, an 8-bit processor has a data bus of this widthand most operations in its CPU use 8bits. The address bus need not have the same width as the data bus andis often wider. • Addresses are always quoted in hexadecimal. Each hex digit is knownas nibbles. • External memory can be added using a separate interfacesuch as SPI.

  11. Volatile and Nonvolatile Memory • Memory can be classified into two main varieties: • Volatile: Loses its contents when power is removed. It is usually called random-accessmemory or RAM. The vital feature is that data can be read or written withequal ease.The memory is usually static RAM. • Nonvolatile: Retains its contents when power is removed and is therefore used for theprogram and constant data. It is usually called read-only memory or ROM. Most modern microcontrollers can writeto their nonvolatile memory but it is much slower and more complicated than writingto RAM.

  12. Volatile and Nonvolatile Memory • There are many types of nonvolatile memory in use: • Masked ROM: The data are encoded into one of the masks used for photolithographyand written into the IC during manufacture. • EPROM (electrically programmable ROM): As its name implies, it can beprogrammed electrically but not erased. Devices must be exposed to (UV)light for about ten minutes. • OTP (one-time programmable memory): This is just EPROM in a normal packagewithout a window, which means that it cannot be erased. • Flash memory: This can be both programmed and erased electrically and is now by farthe most common type of memory. The practical difference is that individual bytes ofEEPROM can be erased but flash can be erased only in blocks. • Most MSP430 devicesuse flash memory, shown by an F in the part number.

  13. Harvard and von Neumann Architectures • General-purpose processors use almostexclusively the von Neumann architecture but both are used in microcontrollers. Harvard Architecture • The volatile (data) and nonvolatile (program) memories are treated as separate systems • Many microcontrollers use this architecture,including Microchip PICs, the Intel 8051 and the ARM9. • It allows simultaneous access to the program and data memories. • The constant data (often lookup tables) must bestored in the program memory because it is nonvolatile. This means that constants cannotbe read in the same way as volatile values from the data memory. Special “table read”instructions must be provided. Von Neumann Architecture • There is only a single memory system in the von Neumann or Princeton architecture. • Only one set of addresses covers both the volatile and nonvolatile memories. • Several memory cycles may be needed to extract a full instruction from memory. • The system is simpler and there is no difference between access to constant and variabledata. • Microcontrollers with a von Neumann architecture include the MSP430, theFreescale HCS08, and the ARM7.

  14. Harvard and von Neumann Architectures

  15. Software • The CPUin a microcontroller spends much of its time interacting with peripherals, although it mayhave to perform some calculations on the values. • Several languages may be used for programming a small microcontroller: • Machine code: The binary data that the processor itself understands. • Assembly language: Theinstructions are written as words called mnemonics rather than binary values and aprogram called an assembler translates the mnemonics into machine code. • C: The most common choice for small microcontrollers nowadays. A compilertranslates C into machine code that the CPU can process.

  16. Where Does the MSP430 Fit? • The MSP430 was introduced in the late 1990s and it is the simplest microcontroller in TI’s current portfolio. • It is a particularly straightforward 16-bit processor with a vonNeumann architecture, designed for low-power applications. • The CPU is often describedas a reduced instruction set computer (RISC). • The address and data buses are 16 bits wide. • The registers in the CPU are also all 16 bitswide and can be used interchangeably for either data or addresses. This makes theMSP430 simpler than an 8-bit processor with 16-bit addresses. • The MSP430 fits between traditional 8- and 16-bit processors. The 16-bitdata bus and registers clearly define it as a 16-bit processor. It canaddress only 216 = 64KB of memory.

  17. Where Does the MSP430 Fit? • It is extremely easy to put the device into a low-power mode. No specialinstruction is needed: The mode is controlled by bits in the status register. • TheMSP430 is awakened by an interrupt and returns automatically to its low-powermode after handling the interrupt. • There is a wide choice of clocks. The MSP430 can wake from a standbymode rapidly, perform its tasks, and return to a low-power mode. • A wide range of peripherals is available, many of which can run autonomouslywithout the CPU for most of the time.

  18. Where Does the MSP430 Fit? • The MSP430 canrestart quickly because of its DCO, which may be an important factor in the overall powerbudget. • Currently four families of MSP430 are available. • The letter after MSP430 shows the typeof memory. Most part numbers include F for flash memory but some have C for ROM. • There is a second letter to show the type of measurement for which they areintended: E for electricity,Wfor water, and G for signals that require a gain stage,provided by operational amplifiers. • The next digit shows the family and the final two orthree digits identify thespecific device.

  19. Where Does the MSP430 Fit? • MSP430x1xx: It can be used as a digital signalprocessor. Packages have 20–64 pins. • MSP430F2xx: Introduced in 2005. Its CPU can run at16 MHz. Some come in 14-pin packages, including a traditional plasticdual-in-line (PDIP) option. Pull-up orpull-down resistors are provided on the inputs to reduce the number of externalcomponents needed. There are many options for analog inputs. Even the smallest,14-pin devices offer a 16-bit sigma–delta ADC. • MSP430x3xx: The original family, which includes drivers for LCDs. It is nowobsolescent. • MSP430x4xx: Can drive LCDs with up to 160 segments. Many of them are ASSPs(application-specific standard product), butthere are general-purpose devices as well. Their packages have 48–113 pins, many ofwhich are needed for the LCD. • MSP430X: The original MSP430 architecture.It can address extra memory. • Curiously, this is not marketed as a separate family: The devices are included in the • MSP430F2xx and MSP430F4xx families with nothing in their part number todistinguish them. The CPU is a MSP430x if there is more than 64KB of memory.

  20. Where Does the MSP430 Fit? • The letters MSP stand for mixed signal processor, which is a reminder that many practicalapplications require analog inputs. There is a selection of analog-to-digital converters witha resolution of up to 16 bits. • The analog output of the amplifier is converted to a binary value in ananalog-to-digital converter.

  21. MSP430

More Related