Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
9
Добавлен:
21.12.2020
Размер:
8.16 Mб
Скачать

PIC18F8722 FAMILY

22.1Comparator Configuration

There are eight modes of operation for the comparators, shown in Figure 22-1. Bits CM2:CM0 of the CMCON register are used to select these modes. The TRISF register controls the data direction of the comparator pins for each mode. If the Comparator

mode is changed, the comparator output level may not be valid for the specified mode change delay shown in

Section 28.0 “Electrical Characteristics”.

Note: Comparator interrupts should be disabled during a Comparator mode change; otherwise, a false interrupt may occur.

FIGURE 22-1:

COMPARATOR I/O OPERATING MODES

 

 

 

 

 

 

 

 

 

 

 

Comparators Reset

 

 

 

 

 

Comparators Off (POR Default Value)

 

CM2:CM0 = 000

 

 

 

 

 

CM2:CM0 = 111

 

 

 

 

 

 

 

RF6/AN11

A

VIN-

 

 

 

RF6/AN11

D

 

VIN-

 

 

 

 

 

 

 

 

 

 

 

RF5/AN10/

A

VIN+

 

C1

 

Off (Read as ‘0’)

RF5/AN10/

D

 

 

 

 

VIN+

 

C1

 

Off (Read as ‘0’)

 

 

 

 

 

 

 

 

CVREF

 

 

 

 

 

 

CVREF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RF4/AN9

A

VIN-

 

 

 

RF4/AN9

D

 

 

VIN-

 

 

 

 

 

 

 

 

 

 

 

RF3/AN8

A

VIN+

C2

 

Off (Read as ‘0’)

RF3/AN8

D

 

VIN+

C2

 

Off (Read as ‘0’)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Two Independent Comparators

 

Two Independent Comparators with Outputs

 

CM2:CM0 = 010

 

 

 

CM2:CM0 = 011

 

 

 

 

RF6/AN11

A

VIN-

 

 

RF6/AN11

A

VIN-

 

 

 

 

 

 

 

 

 

 

 

 

 

RF5/AN10/

A

VIN+

C1

C1OUT

RF5/AN10

A

VIN+

C1

C1OUT

 

 

 

 

 

 

CVREF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RF2/AN7/C1OUT*

 

 

 

 

RF4/AN9

A

VIN-

 

 

 

A

VIN-

 

 

 

 

 

VIN+

C2

C2OUT

RF4/AN9

 

 

 

RF3/AN8

A

 

 

 

 

 

 

 

 

C2

C2OUT

 

 

 

RF3/AN8

A

VIN+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RF1/AN6/C2OUT*

 

 

 

 

Two Common Reference Comparators

 

Two Common Reference Comparators with Outputs

CM2:CM0 = 100

 

 

 

CM2:CM0 = 101

 

 

 

 

RF6/AN11

A

VIN-

 

 

RF6/AN11

A

VIN-

 

 

 

RF5/AN10/

A

VIN+

C1

C1OUT

RF5/AN10/

A

VIN+

C1

C1OUT

 

 

 

 

 

 

 

 

 

 

CVREF

 

 

 

 

 

CVREF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RF2/AN7/

 

 

 

 

 

RF4/AN9

A

VIN-

 

 

C1OUT*

 

 

 

 

 

 

 

 

 

 

 

 

 

RF3/AN8

D

VIN+

C2

C2OUT

RF4/AN9

A

VIN-

 

 

 

 

 

 

 

 

C2

C2OUT

 

 

 

 

 

 

RF3/AN8

D

VIN+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RF1/AN6/C2OUT*

 

 

 

 

One Independent Comparator with Output

Four Inputs Multiplexed to Two Comparators

 

CM2:CM0 = 001

 

 

 

CM2:CM0 = 110

 

 

 

 

RF6/AN11

A

VIN-

 

 

RF6/AN11

A

 

 

 

 

 

 

 

 

CIS = 0

VIN-

 

 

 

 

 

C1

C1OUT

 

A

 

 

RF5/AN10/

A

VIN+

RF5/AN10/

CIS = 1

VIN+

C1

C1OUT

 

 

 

 

CVREF

 

 

 

 

CVREF

 

 

 

 

 

RF2/AN7/

 

 

 

 

RF4/AN9

A

CIS = 0

VIN-

 

 

C1OUT*

 

 

 

 

 

A

 

 

RF4/AN9

D

VIN-

 

 

RF3/AN8

CIS = 1

VIN+

C2

C2OUT

 

 

 

 

 

 

 

 

 

 

 

 

RF3/AN8

D

 

 

VIN+

 

 

C2

 

Off (Read as ‘0’)

 

CVREF

From VREF Module

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A = Analog Input, port reads zeros always

D = Digital Input

CIS (CMCON<3>) is the Comparator Input Switch

* Setting the TRISF<2:1> bits will disable the comparator outputs by configuring the pins as inputs.

DS39646B-page 282

Preliminary

2004 Microchip Technology Inc.

Соседние файлы в папке Склад