Ch. 7: Microcontroller Programming and Interfacing

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

1) What is ROM? What is its function? 2) What is RAM? What is its function? Types? 3) What is EPROM? What is its function? EEPROM?

1) ROM: read-only memory - Used for permanent storage of data - CPU can read from ROM but NOT write to ROM - "Nonvolatile memory": does not require a power supply to retain data 2) RAM: random-access memory - Can be read from or written to at any time as long as power is maintained - "Volatile memory": memory is lost when power is removed - 2 Types: a) static RAM (SRAM): retains data in flip-flops as long as the memory is powered b) dynamic RAM (DRAM): capacitor storage of data, must be periodically refreshed (rewritten) due to capacitor charge leakage Imagery: like the animal, a ram, RAM is volatile and dangerous 3) EPROM: erasable-programmable read-only memory - Can be erased by UV light that is applied through a transparent quartz window directly above the EPROM IC - New data can be stored after erased - Another type: EEPROM = electrically EPROM: can be electrically erased and rewritten

What are the two branches of the microprocessor?

1. CPUs for the personal computer and workstation industry. - Main Constraints: speed and (bit) size 2. Microcontrollers

How can code be written for a microprocessor? Pros and cons of each?

1. In machine code or in assembly language. - Faster, requires less memory 2. High-level language like BASIC of C - Easier to learn and use - Programs are easier to debug - Programs are easier to comprehend - Machine code that results when converted may be less efficient

What are the different types of memory? List them.

1. Read-only memory (ROM) 2. Random-access-memory (RAM) 3. Erasable-programmable read-only memory (EPROM)

What does ALU stand for? What function does it serve?

ALU = arithmetic logic unit. performs mathematical calculations and logic on binary words

7.1: Microprocessors and Microcomputers

COMPLETE

7.2: Microcontrollers

COMPLETE

What does CPU stand for and what is its function? What doe MPU stand for?

CPU = central processing unit MPU = microprocessor unit CPU = MPU = microprocessor (all interchangeable) most important piece, processes the data in the computer.

What does a microprocessor consist of? List the components and describe the functionality of each.

Components: - ALU: 1) performs mathematical functions on binary sets 2) Performs manipulations on info stored in the data registers - Control Unit: 1) provides instructions retrieved from memory 2) Sends information to memory - Instruction Register: stores instructions from the ctrl unit until retrieved by the instruction decoder - Instruction Decoder: interprets/decodes instruction from the ctrl unit - Data Registers: stores result from ALU until it can be transferred to memory by the control unit

What are all of the components of a full-featured microcontroller? Draw a block diagram of a full-featured microcontroller. Include external devices that can be interfaced with the microcontroller.

Components: - CPU - RAM - ROM - Digital I/O ports - Serial communication interface - Timers - Analog-to-digital converters (A/D) - Digital-to-analog converters (D/A)

What functions do each of the components in a microcontroller perform?

Components: CPU: executes the software stored in ROM and controls all of the microcontroller components RAM: stores settings and values used by an executing program ROM: stores the program and any permanent memory - Program can be permanently installed on IC ROM by manufacturer - Or, can programmed by the user and stored in the form of EPROM or EEPROM - Digital I/O ports: allow for binary information to be transmitted to and from the microcontroller via the external pins on the IC - Ex. read state of switches, interface w/ external A/D or D/A Serial communication interface: also capable of transmitting data like the digital I/O ports as long as serial communication form is the same Timers: create delays or ensure events happen at specific time intervals Analog-to-digital converters (A/D): converts an external analog signal from a sensor to a digital signal that can be processed by the CPU Digital-to-analog converters (D/A): allows microcontroller to output an analog signal to a nondigital device

Compare and contrast a hardware solution and a software solution.

How They Differ: 1) Electronic components they consist of 2) Predetermined vs. modifiable outputs 3) Requirements to modify the system. 4) Types of applications best suited for. Hardware Solution: 1) Combinational and sequential logic devices (IC's) 2) Predetermined functions/outputs 3) To modify function, must modify the hardware/reconfigure 4) Good for simple tasks Software Solution: 1) Contains a microprocessor or microcomputer 2) Modifiable output (programmable) 3) Program can be modified to change the functionality of the system without impacting the hardware of the system 4) Good for complex relationships and systems

7.3: The PIC16F84 Microcontroller

INCOMPLETE

7.4: Programming a PIC

INCOMPLETE

Compare and contrast microcontrollers and microcomputers.

Microcontrollers: - Small RAM, measured in kilobytes - Slower clock speeds Microcomputers: - Larger RAM, measured in gigabytes - Faster clock speeds

What does PORTA and PORTB mean? (PIC16F84) What does OSC stand for? Function? What does (MCLR)^bar stand for? Function?

PORTA: refers to the five I/O pins (RA0-RA4) PORTB: refers to the eight I/O pins (RB0-RB7) OSC1, OSC2: Oscillator crystal inputs - Control the clock of the PIC. (MCLR)^bar: master clear (active low) - provides a reset feature - Grounding pin causes PIC to reset and restart the program stored in EEPROM

Compare and contrast a simulator and an emulator.

Similarities: - Both for testing out a microcontroller code Differences: simulator: - software - Runs the microcontroller code on the PC emulator: emulate = imitate - hardware - Physically connects the microcontroller and PC and allows the PC to control the microcontroller while it in the mechatronics system.

Compare and contrast an assembler and a cross-assembler.

Similarities: Both are software that convert assembly language to machine code for a microprocessor. Differences: assembler: generates machine code for the same device - Ex. generates machine code for the microprocessor in the same PC the assembly language was written w/ cross-assembler: generates machine code for a different microprocessor than the one the assembly code was written on. - Ex. generates machine code for a microcontroller from assembly language written on a PC

What is firmware? How to remember?

Software that has been permanently stored in ROM How to Remember: - Firm is middle ground between soft and hard - "It's the software a microcontroller/microcomputer will never forget." - Image: a microcontroller IC w/ "bad" firmware tattoo

What does USB stand for? Imagery?

Universal Serial Bus Imagery: a "bus" with the nose of a USB port and the body of the Universal studios planet logo serving as a bowl that is full of "cereal"

Why is the microcontroller widely developed and used? Why are microcontrollers popular in mechatronic design?

Why Microcontrollers? 1. Low cost 2. Versatility 3. Ease of programming 4. Small size Why microcontrollers in mechatronics design? 1. Size - small 2. Versatility - wide range of functions

What is the instruction set for a microcontroller?

a list of commands that control all of the functions of the microcontroller

What is a microcomputer?

a microprocessor that is packaged on a printed circuit board w/ other component like an interface, I/O, and memory chips.

What is bus? Function? Analogy? Imagery?

a set of communication lines Analogy: the "central nervous system of the microcomputer" Information Shared via the Bus: - Data signals - Address signals - Control signals Imagery: think bus and communication lines - Image: a string phone where the cups are school buses instead of cups

What is a microcontroller? What is it made of? Examples? Other names?

a single IC that contains specialized circuits and functions suited to a mechatronics application. - Basically a simple version of a microcomputer on a single IC Contains: - Microprocessor - Memory - I/O capabilities - Other on chip resources Examples: - PIC - Arduino Other Names: MCU = microcontroller units

What is a microprocessor? Function? Analogy? How to remember? Draw a block diagram of a microprocessor

a single IC where the primary computations and system control operations occur - Ex functions: arithmetic, logic, ctrl functions How to Remember: What is a microprocessor ("system") made of? Biggest components: - control unit (i.e. system control operations) - ALU (i.e. primary computations machine) (everything else is simply just storage (i.e. registers) or decoders Connection: essentially the brain/nucleus of the cell/electronic device

What is the working register/ W register / accumulator?

a special register in the CPU that temporarily stores immediate arithmetic and logic values for calculations and comparisons.

What is meant by a bidirectional I/O pin/line?

bidirectional means that the pin can be configured as either an input or an output.

What are file registers in a PIC?

byte-sized locations in RAM whose bits are used to ctrl functions and indicate the status of the microcontroller

What are data lines? Function? What are address lines? Function? What are control lines? Function?

data lines: communicate (binary) information in the form of bits to and from different devices address lines: used to select devices or memory based on location. Essentially, they determine the "address"/location of the device or memory. control lines: transmit any control information: read, write, clock information, etc. - Control flow of data and when it can be accessed

What is an emulator? Imagery?

hardware that connects a PC to a microcontroller in a prototype system. - Emulator can be used to load and run a program on the microcontroller w/ all the mechatronics hardware attached. - Allows the PC to run and control a program on the microcontroller while it is embedded in the system.. Imagery:

What is the watch-dog timer on a PIC? What is a scenario where this could come in handy?

it is a special purpose timer that is included on a PIC that counts down when activated. - Must be continually reset by the running program. - If counts down to 0 w/o being reset by running program, PIC automatically resets itself. Example Application: - Can be used to reset the PIC in the event that the code is caught in an endless loop.

What is the PIC16F84? Why is it used as the microcontroller of choice in the textbook?

low cost 8-bit microcontroller w/ EEPROM flash memory for program and data storage. - 13 I/O lines - Does NOT have A/D or D/A converters - Does NOT have serial communication Why? - Good starting place - Cheap and easy to program - Compatible w/ many other PICs

What is machine code? What is assembly language? What is an assembler?

machine code: a binary code with instructions that can be executed by the CPU - specific to each microprocessor assembly language: code that has a mnemonic command corresponding to each instructions - Ex: ADD to add a number to register, MOV to move register's value to memory - Can use to program a microprocessor assembler: software that converts assembly language to machine code - assembly language must be converted to machine code before the CPU can use it.

What is an interrupt?

occurrence that happens when a specifically designated input changes state. - Interrupts normal program execution, and a special interrupt portion of program is executed.

What does PIC stand for?

peripheral interface controller

What I/O devices? I/O devices for a computer? I/O devices for a microcontroller?

provide communication to and from the microprocessor via the I/O connected to the bus. Computer (external): - keyboards - printers - displays Mechatronics / microcontrollers: (the following provide interfaces btw switches, sensors, and actuators) - analog-to-digital (A/D) devices - digital-to-analog (D/A) devices - digital I/O (D/D)

What are binary words?

simply an ordered set of bits, usually 8, 16, 32, 64 bits in length

What is cross-assembler software?

software that generates machine code for a microcontroller from code written in assembly language on a PC.

What is a simulator? Imagery?

software that runs on a PC and allows the microcontroller software to be simulated (run) on the PC. Imagery:

When used as a subscript, what do ss and dd stand for? What does V_ss stand for? What does V_dd stand for?

ss = source dd = drain V_ss = power supply ground reference (where the ground is connected to the PIC) V_dd = positive supply (Where the power is connected to the PIC)


संबंधित स्टडी सेट्स

Chapter 12 - Nervous System: Nervous Tissue

View Set

Management 3301- Test Prep Questions Chapter 7: organization structure and Design

View Set

MATH 19B study guide review reimen sums and maybe 5.9/5.1 also look up tricky integral solutions like 1/a root fix 35

View Set

Product, Branding, and Packaging

View Set

AP Euro- Chapter 19 French Revolution and Napoleon AP Exam Review Quiz

View Set