37
bocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung ust.hk] WONG Long Sing (Sam) [sam hellosam.net]

Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Embed Size (px)

Citation preview

Page 1: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, Hong Kong University of Science & Technology

Robocon 2007Electronics Quickstart!

Robocon 2007Electronics Quickstart!

Session 2 PreludeLogic

Prepared by KI Chi Keung [chikeung @ ust.hk]

WONG Long Sing (Sam) [sam @ hellosam.net]

Page 2: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Table of Contents

1. MOSFET1. NMOS

2. PMOS

3. CMOS

2. Buffer

3. MCU Application

Page 3: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

NMOS

Symbol Physical Cross SectionSee Wikipedia, MOSFET

Gate

Source

Drain

Page 4: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

NMOS

VGS < Vth

Cut-off ModeVth = Thershold Voltage ≈ 1.5V (Model dependent)

IDS = 0

Gate

Source

Drain

Page 5: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

NMOS

VGS > Vth

Linear Mode

VDS > VGS - Vth

IDS will be large

Gate

Source

Drain

Page 6: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

PMOS

Symbol

Gate

Drain

Source

Page 7: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

PMOS

VGS < Vth

Cut-off ModeVth = Thershold Voltage ≈ -1.5V (Model dependent)

IDS = 0Gate

Drain

Source

Page 8: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

PMOS

VGS < Vth

Linear Mode

VDS < VGS - Vth

IDS will be largeGate

Drain

Source

Page 9: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MOS

Other commonly seen schematic symbolsSee Wikipedia, MOSFET

            

N-channel

P-channel

Page 10: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

CMOS - Inverter

Source

Drain

• Not a new type of MOS, but • It means combining the use of PMOS and

NMOS to form interesting logic circuit

Output

Source

Input

Page 11: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

CMOS - Inverter

Symbol

OutputInput

Page 12: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

CMOS - Inverter

Input High, Output Low

5V

0V

0V5V

Page 13: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

CMOS - Inverter

Input Low, Output High

5V

0V

5V0V

Page 14: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer

Symbol

Logically same as two inverters in serial

OutputInput

OutputInput

Page 15: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer

5V

0V

5V

0V

0V0V

Page 16: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer

5V

0V

5V

0V

5V5V

Page 17: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer

With an appropriate buffer, we get a…

• Low impedance output

• Strong output

• Good output

• Internal resistance of the power source is low

regardless of the input impedance.

Page 18: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer with Enable

Symbol

OutputInput

Enable

Page 19: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer with Enable

OutputInput

Enable

Transmission Gate

Page 20: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer with Enable

5V5V

5V

Page 21: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer with Enable

0V0V

5V

Page 22: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

Buffer with Enable

Floating

Hi-Z

Hi-Impedance

< 5V + Vth

> 0V - Vth

5V

0V

Page 23: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application

Device A Device B

PORT

DDR

PORT

DDR

Page 24: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application

Device ADDR = 1

PORT = 0

Device BDDR = 1

PORT = 0

0V

5V

0V

5V0V

Page 25: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application

Device ADDR = 1

PORT = 0

Device BDDR = 0

0V

5V

X

0V0V

Page 26: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application

Device ADDR = 1

PORT = 1

Device BDDR = 1

PORT = 0

5V

5V

0V

5V~2.5V

Page 27: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application

Device ADDR = 0

Device BDDR = 0

X

0V

X

0VX

Page 28: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device A Device B

PORT

DDR

PIN

PORT

DDR

PIN

DDR | ~PORT DDR | ~PORT

Page 29: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 0

PORT = 0

Device BDDR = 0

PORT = 0

0V

0V

X

0V

0V

X

5V 5V

X

Page 30: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 0

PORT = 1

Device BDDR = 0

PORT = 0

0V

0V

1

5V

0V

1

0V 5V

5V

Page 31: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 1

PORT = 0

Device BDDR = 0

PORT = 0

0V

0V

0

0V

5V

0

5V 5V

0V

Page 32: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 1

PORT = 1

Device BDDR = 0

PORT = 1

5V

0V

1

5V

5V

1

5V 0V

5V

Page 33: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 1

PORT = 0

Device BDDR = 0

PORT = 1

5V

0V

0

0V

5V

0

5V 0V

0V

Page 34: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 1

PORT = 1

5V

5V

1

5V

5V

Page 35: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 1

PORT = 1

5V

5V

X

5V

Tends to 0V

Page 36: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 0

PORT = 1

5V

0V

1

0V

5V

Page 37: Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 2 Prelude Logic Prepared by KI Chi Keung [chikeung

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 0

PORT = 1

5V

0V

0

0V

0V