Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Архив4 / Proshin_polnostyu_ves_kursach / pic18f2455_2550_4455_4550.pdf
Скачиваний:
49
Добавлен:
07.08.2013
Размер:
7.07 Mб
Скачать

PIC18F2455/2550/4455/4550

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 TRISA 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

 

 

 

 

 

 

 

 

RA0/AN0

A

VIN-

 

 

 

RA0/AN0

D

 

VIN-

 

 

 

RA3/AN3/

A

VIN+

 

 

C1

 

Off (Read as ‘0’)

RA3/AN3/

 

D

 

 

 

 

VIN+

 

 

C1

 

Off (Read as ‘0’)

 

 

 

 

 

 

 

 

 

 

 

VREF+

 

 

 

 

 

 

 

VREF+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RA1/AN1

A

VIN-

 

 

 

RA1/AN1

D

 

VIN-

 

 

 

A

VIN+

 

 

C2

 

Off (Read as ‘0’)

RA2/AN2/

 

D

 

 

 

 

 

VIN+

 

 

C2

 

Off (Read as ‘0’)

RA2/AN2/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VREF-/CVREF

 

 

 

 

 

 

VREF-/CVREF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Two Independent Comparators

 

 

Two Independent Comparators with Outputs

 

CM2:CM0 = 010

 

 

 

 

CM2:CM0 = 011

 

 

 

 

RA0/AN0

A

VIN-

 

 

 

RA0/AN0

A

VIN-

 

 

 

RA3/AN3/

A

VIN+

C1

C1OUT

 

RA3/AN3/

A

VIN+

C1

C1OUT

 

VREF+

 

 

 

 

 

VREF+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RA4/T0CKI/C1OUT*/RCV

 

 

 

RA1/AN1

A

VIN-

 

 

 

RA1/AN1

A

VIN-

 

 

 

 

 

VIN+

C2

C2OUT

 

 

 

 

RA2/AN2/

A

 

 

 

 

 

 

 

 

 

 

C2

C2OUT

 

 

 

 

RA2/AN2/

A

VIN+

 

VREF-/CVREF

 

 

 

 

 

 

 

 

 

VREF-/CVREF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RA5/AN4/SS/HLVDIN/C2OUT*

 

 

Two Common Reference Comparators

 

 

Two Common Reference Comparators with Outputs

CM2:CM0 = 100

 

 

 

 

CM2:CM0 = 101

 

 

 

 

RA0/AN0

A

VIN-

C1

C1OUT

 

RA0/AN0

A

VIN-

C1

C1OUT

 

RA3/AN3/

A

VIN+

 

RA3/AN3/

A

VIN+

 

 

 

 

 

 

 

VREF+

 

 

 

 

 

VREF+

 

 

 

 

 

 

 

 

 

 

 

RA4/T0CKI/C1OUT*/

 

 

 

RA1/AN1

A

VIN-

 

 

 

RCV

 

 

 

 

 

 

 

 

RA1/AN1

A

VIN-

 

 

 

RA2/AN2/

D

VIN+

C2

C2OUT

 

 

 

 

 

 

 

RA2/AN2/

 

VIN+

C2

C2OUT

 

VREF-/CVREF

 

 

 

 

D

 

 

 

 

 

VREF-/CVREF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RA5/AN4/SS/HLVDIN/C2OUT*

 

 

One Independent Comparator with Output

 

Four Inputs Multiplexed to Two Comparators

 

CM2:CM0 = 001

 

 

 

 

CM2:CM0 = 110

 

 

 

 

RA0/AN0

A

VIN-

 

 

 

RA0/AN0

A

 

 

 

 

 

 

 

 

CIS = 0

VIN-

 

 

 

 

C1

C1OUT

 

 

A

 

 

RA3/AN3/

A

VIN+

 

RA3/AN3/

CIS = 1

VIN+

C1

C1OUT

VREF+

 

 

 

 

 

VREF+

 

 

 

 

 

 

 

 

 

 

 

 

RA4/T0CKI/C1OUT*/RCV

 

 

 

RA1/AN1

A

CIS = 0

VIN-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A

 

 

 

D

VIN-

 

 

 

RA2/AN2/

CIS = 1

VIN+

C2

C2OUT

RA1/AN1

 

 

 

VREF-/CVREF

 

 

 

Off (Read as ‘0’)

 

 

 

 

RA2/AN2/

D

VIN+

C2

 

 

 

CVREF From VREF Module

 

 

 

 

 

 

VREF-/CVREF

 

 

 

 

 

 

 

A = Analog Input, port reads zeros always

D = Digital Input

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

* Setting the TRISA<5:4> bits will disable the comparator outputs by configuring the pins as inputs.

 

 

DS39632D-page 270

Preliminary

2007 Microchip Technology Inc.

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