Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart!...

Post on 13-Jan-2016

216 views 0 download

Transcript of Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart!...

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]

Robocon 2007, HKUST

Table of Contents

1. MOSFET1. NMOS

2. PMOS

3. CMOS

2. Buffer

3. MCU Application

Robocon 2007, HKUST

NMOS

Symbol Physical Cross SectionSee Wikipedia, MOSFET

Gate

Source

Drain

Robocon 2007, HKUST

NMOS

VGS < Vth

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

IDS = 0

Gate

Source

Drain

Robocon 2007, HKUST

NMOS

VGS > Vth

Linear Mode

VDS > VGS - Vth

IDS will be large

Gate

Source

Drain

Robocon 2007, HKUST

PMOS

Symbol

Gate

Drain

Source

Robocon 2007, HKUST

PMOS

VGS < Vth

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

IDS = 0Gate

Drain

Source

Robocon 2007, HKUST

PMOS

VGS < Vth

Linear Mode

VDS < VGS - Vth

IDS will be largeGate

Drain

Source

Robocon 2007, HKUST

MOS

Other commonly seen schematic symbolsSee Wikipedia, MOSFET

            

N-channel

P-channel

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

Robocon 2007, HKUST

CMOS - Inverter

Symbol

OutputInput

Robocon 2007, HKUST

CMOS - Inverter

Input High, Output Low

5V

0V

0V5V

Robocon 2007, HKUST

CMOS - Inverter

Input Low, Output High

5V

0V

5V0V

Robocon 2007, HKUST

Buffer

Symbol

Logically same as two inverters in serial

OutputInput

OutputInput

Robocon 2007, HKUST

Buffer

5V

0V

5V

0V

0V0V

Robocon 2007, HKUST

Buffer

5V

0V

5V

0V

5V5V

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.

Robocon 2007, HKUST

Buffer with Enable

Symbol

OutputInput

Enable

Robocon 2007, HKUST

Buffer with Enable

OutputInput

Enable

Transmission Gate

Robocon 2007, HKUST

Buffer with Enable

5V5V

5V

Robocon 2007, HKUST

Buffer with Enable

0V0V

5V

Robocon 2007, HKUST

Buffer with Enable

Floating

Hi-Z

Hi-Impedance

< 5V + Vth

> 0V - Vth

5V

0V

Robocon 2007, HKUST

MCU Application

Device A Device B

PORT

DDR

PORT

DDR

Robocon 2007, HKUST

MCU Application

Device ADDR = 1

PORT = 0

Device BDDR = 1

PORT = 0

0V

5V

0V

5V0V

Robocon 2007, HKUST

MCU Application

Device ADDR = 1

PORT = 0

Device BDDR = 0

0V

5V

X

0V0V

Robocon 2007, HKUST

MCU Application

Device ADDR = 1

PORT = 1

Device BDDR = 1

PORT = 0

5V

5V

0V

5V~2.5V

Robocon 2007, HKUST

MCU Application

Device ADDR = 0

Device BDDR = 0

X

0V

X

0VX

Robocon 2007, HKUST

MCU Application – Pull Up

Device A Device B

PORT

DDR

PIN

PORT

DDR

PIN

DDR | ~PORT DDR | ~PORT

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

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

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

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

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

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 1

PORT = 1

5V

5V

1

5V

5V

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 1

PORT = 1

5V

5V

X

5V

Tends to 0V

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 0

PORT = 1

5V

0V

1

0V

5V

Robocon 2007, HKUST

MCU Application – Pull Up

Device ADDR = 0

PORT = 1

5V

0V

0

0V

0V