Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller •...

43
Microcontroller Interfacing

Transcript of Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller •...

Page 1: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Microcontroller Interfacing

Page 2: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Output Levels

Page 3: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Interpretation of Timing

Diagrams

Page 4: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Analog to Digital Converters

• Sampling rate (MHZ)

• Sampling resolution (bits)

• Interface type (parallel or serial)

• Reference voltage (volt)

• Input range (unipolar or bipolar)

• Sample-and-hold circuit usually inside chip

• Note: Analog antialiasing filter must be in place

Page 5: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

ADC Technologies

Page 6: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Parallel Interface Example

Page 7: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Serial Interface Example

Page 8: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Memory

• External interface possible in most cases

• Nonvolatile EPROM

• Voltile RAM (SRAM, DRAM, etc.)

• Nonvolatile EEPROM

• Nonvolatile FLASH

• Refer to timing diagram for each to know how

to interface with microcontroller

Page 9: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Temperature Sensors

• Thermistors (PTC, NTC)

Page 10: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Optical Sensors

• Switches

• Isolators

Page 11: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Magnetic Sensors

• LVDT

• Hall effect

Page 12: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Mechanical Switch

Page 13: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Motor Interfacing

• Stepper motor

Page 14: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Motors

• DC motor

Page 15: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Motors

• Brushless DC

Page 16: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

TRIACs

Page 17: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Microcontrollers

• Which microcontroller to use?

– 8051

– PIC

– ARM

– AD

– TI

Page 18: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

8051 Summary

• Selection of microcontroller

• Definition of pins

• Block diagram

• Instruction set

• Memory map

• I/O ports

• Timers

• Interrupts

• UART

• Practical development

Page 19: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Microcontroller Architecture

Page 20: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Microcontroller Selection

Page 21: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Pin Diagram

Page 22: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 23: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 24: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 25: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 26: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 27: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 28: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 29: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 30: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 31: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 32: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Addressing Modes

Page 33: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Addressing Modes

Page 34: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 35: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 36: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 37: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

I/O Ports

Page 38: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 39: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports
Page 40: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

UART

Page 41: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Practical Development

Page 42: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports

Standard Software Development

Process1. Create or edit an ASCII text file containing the human readable

source code, also known as the program instructions.

2. Translate the source code to machine-readable binary instruction code using a language translator. This is accomplished using an assembler or compiler.

3. Load the program memory with the binary instruction code into the processor’s program memory chip. For the SDK, the program is downloaded into program memory on the SDK.

4. Execute the program to test it and find program errors. For the SDK, this “debugging” process is facilitated using a special program (debugger or monitor) resident on the SDK.

5. Once the problem is located, the source code is corrected by repeating this process until all errors are corrected.

Page 43: Microcontroller Interfacing - k-space.org · 8051 Summary • Selection of microcontroller • Definition of pins • Block diagram • Instruction set • Memory map • I/O ports