Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
даташитина PIC 12F683 .pdf
Скачиваний:
15
Добавлен:
02.02.2015
Размер:
3.06 Mб
Скачать

PIC12F683

4.2.5PIN DESCRIPTIONS AND DIAGRAMS

Each GPIO pin is multiplexed with other functions. The pins and their combined functions are briefly described here. For specific information about individual functions such as the comparator or the ADC, refer to the appropriate section in this data sheet.

4.2.5.1GP0/AN0/CIN+/ICSPDAT/ULPWU

Figure 4-1 shows the diagram for this pin. The GP0 pin is configurable to function as one of the following:

a general purpose I/O

an analog input for the ADC

an analog input to the comparator

In-Circuit Serial Programming™ data

an analog input to the Ultra Low-Power Wake-up

FIGURE 4-1: BLOCK DIAGRAM OF GP0

Analog

Input Mode(1)

VDD

Data Bus

D

Q

 

 

Weak

 

 

 

WR

CK

Q

 

GPPU

 

WPU

 

 

 

 

RD

 

 

 

 

 

WPU

 

 

 

 

VDD

 

D

Q

 

 

 

WR

CK

Q

 

 

I/O pin

 

 

 

GPIO

 

 

 

 

 

 

 

 

 

 

 

 

 

VSS

 

 

 

 

-

VT

 

 

 

 

+

 

D

Q

 

 

 

WR

CK

Q

 

 

IULP

TRISIO

 

 

RD

 

 

0

1

 

 

Analog

 

 

 

TRISIO

 

 

 

VSS

 

 

Input Mode(1)

 

 

 

 

ULPWUE

 

 

 

 

 

RD

 

 

 

 

 

GPIO

 

 

 

 

 

 

D

Q

 

 

 

WR

CK

Q

D

 

 

Q

 

 

 

IOC

 

 

 

Q3

 

 

 

 

EN

 

RD

 

 

 

 

 

IOC

 

Q

D

 

 

 

 

 

 

Interrupt-on-

 

EN

 

 

 

 

 

 

Change

 

 

 

 

 

 

RD GPIO

 

 

 

 

To Comparator

 

 

 

 

To A/D Converter

 

 

 

Note 1:

Comparator mode and ANSEL determines Analog Input mode.

 

DS41211D-page 36

2007 Microchip Technology Inc.

PIC12F683

4.2.5.2GP1/AN1/CIN-/VREF/ICSPCLK

Figure 4-2 shows the diagram for this pin. The GP1 pin is configurable to function as one of the following:

a general purpose I/O

an analog input for the ADC

a analog input to the comparator

a voltage reference input for the ADC

In-Circuit Serial Programming clock

FIGURE 4-2: BLOCK DIAGRAM OF GP1

Data

 

Analog

 

 

 

Input Mode(1)

 

 

Bus

 

 

 

D

Q

 

VDD

 

 

 

 

 

 

WR

CK

Q

 

Weak

WPU

 

 

 

 

RD

 

GPPU

 

 

WPU

 

 

 

 

 

D

Q

 

VDD

 

 

 

WR

CK

Q

 

 

GPIO

 

 

 

 

 

 

 

 

 

 

I/O pin

 

D

Q

 

 

WR

CK

Q

 

VSS

TRISIO

 

 

 

Analog

 

 

RD

 

Input Mode(1)

 

TRISIO

 

 

 

 

RD

 

 

 

 

GPIO

 

 

 

 

 

D

Q

 

 

WR

CK

Q

D

 

Q

 

 

IOC

 

 

 

 

 

 

 

EN

Q3

RD

 

 

 

 

IOC

 

Q

D

 

 

 

 

Interrupt-on-

 

EN

 

 

 

 

change

 

 

 

 

 

RD GPIO

 

 

 

To Comparator

 

 

 

To A/D Converter

 

 

Note 1: Comparator mode and ANSEL determines Analog

 

Input mode.

 

 

4.2.5.3GP2/AN2/T0CKI/INT/COUT/CCP1

Figure 4-3 shows the diagram for this pin. The GP2 pin is configurable to function as one of the following:

a general purpose I/O

an analog input for the ADC

the clock input for Timer0

an external edge triggered interrupt

a digital output from the Comparator

a digital input/output for the CCP (refer to

Section 11.0 “Capture/Compare/PWM (CCP)

Module”).

 

 

 

 

FIGURE 4-3:

 

BLOCK DIAGRAM OF GP2

Data

 

 

Analog

 

 

 

 

Input Mode

 

 

Bus

D

Q

VDD

 

 

 

 

 

 

 

 

 

WR

CK

Q

 

Weak

 

WPU

 

 

 

 

 

RD

 

 

GPPU

 

 

WPU

 

 

 

 

 

 

 

 

COUT

Analog

 

 

 

 

Input

 

 

 

 

Enable

Mode

 

 

D

Q

 

VDD

 

 

 

 

 

WR

CK

Q

COUT 1

 

 

GPIO

 

 

 

 

 

0

 

I/O pin

 

 

 

 

 

 

D

Q

 

 

 

WR

CK

Q

 

VSS

 

TRISIO

 

 

 

 

 

Analog

 

RD

 

 

Input Mode

 

 

 

 

 

 

TRISIO

 

 

 

 

 

RD

 

 

 

 

 

GPIO

 

 

 

 

 

 

D

Q

 

 

 

WR

CK

Q

Q

D

 

 

 

 

IOC

 

 

 

 

 

 

 

 

 

EN

Q3

RD

 

 

 

 

 

IOC

 

 

Q

D

 

 

 

 

 

Interrupt-on-

 

 

EN

 

 

 

 

 

change

 

 

 

 

 

 

 

 

RD GPIO

 

To Timer0

To INT

To A/D Converter

Note 1: Comparator mode and ANSEL determines Analog Input mode.

2007 Microchip Technology Inc.

DS41211D-page 37

PIC12F683

4.2.5.4GP3/MCLR/VPP

Figure 4-4 shows the diagram for this pin. The GP3 pin is configurable to function as one of the following:

a general purpose input

as Master Clear Reset with weak pull-up

FIGURE 4-4: BLOCK DIAGRAM OF GP3

 

 

 

 

VDD

 

 

MCLRE

 

Weak

Data

 

 

 

 

Bus

 

Reset

MCLRE

Input

 

 

 

 

 

 

 

pin

RD

 

VSS

 

 

TRISIO

 

 

 

 

RD

 

MCLRE

VSS

 

 

 

 

GPIO

 

 

 

 

 

D

Q

 

 

WR

CK

Q

D

 

Q

 

 

IOC

 

 

 

 

 

 

 

EN

Q3

RD

 

 

 

 

IOC

 

Q

D

 

 

 

 

Interrupt-on-

 

EN

 

 

 

 

change

 

 

 

 

 

RD GPIO

 

4.2.5.5GP4/AN3/T1G/OSC2/CLKOUT

Figure 4-5 shows the diagram for this pin. The GP4 pin is configurable to function as one of the following:

a general purpose I/O

an analog input for the ADC

a Timer1 gate input

a crystal/resonator connection

a clock output

FIGURE 4-5: BLOCK DIAGRAM OF GP4

 

 

Analog

 

 

 

 

 

Input Mode

 

 

Data

 

 

CLK(1)

 

 

 

Modes

 

 

Bus

 

 

 

 

D

Q

 

 

VDD

 

 

 

 

 

 

 

 

WR

CK

Q

 

 

Weak

WPU

 

 

 

 

 

RD

 

GPPU

 

 

WPU

 

 

Oscillator

 

 

 

 

 

 

 

OSC1

Circuit

 

 

 

 

 

 

VDD

 

 

CLKOUT

 

 

 

 

 

 

 

 

Enable

 

 

 

D

FOSC/4

1

 

 

 

Q

 

 

 

WR

CK

 

0

 

I/O pin

Q

 

 

GPIO

 

 

 

 

CLKOUT

 

 

 

 

 

 

 

 

Enable

 

 

 

D

Q

 

 

VSS

 

 

 

 

 

 

INTOSC/

 

 

WR

CK

RC/EC(2)

 

 

TRISIO

Q

 

 

 

 

 

CLKOUT

 

 

RD

 

Enable

 

 

 

 

 

 

 

TRISIO

 

 

Analog

 

 

 

 

 

 

 

 

 

Input Mode

 

 

RD

 

 

 

 

 

GPIO

 

 

 

 

 

 

D

Q

 

 

 

WR

CK

Q

Q

D

 

 

 

 

IOC

 

 

 

 

 

 

 

 

EN

Q3

RD

 

 

 

 

 

IOC

 

 

Q

D

 

 

 

 

 

Interrupt-on-

 

EN

 

 

 

 

 

change

 

 

 

 

 

 

 

RD GPIO

 

 

To T1G

 

 

 

 

To A/D Converter

 

 

 

Note 1: CLK modes are XT, HS, LP, optional LP oscillator and CLKOUT Enable.

2: With CLKOUT option.

DS41211D-page 38

2007 Microchip Technology Inc.

PIC12F683

4.2.5.6GP5/T1CKI/OSC1/CLKIN

Figure 4-6 shows the diagram for this pin. The GP5 pin is configurable to function as one of the following:

a general purpose I/O

a Timer1 clock input

a crystal/resonator connection

a clock input

FIGURE 4-6: BLOCK DIAGRAM OF GP5

 

 

INTOSC

 

 

 

 

Mode

 

 

Data

 

TMR1LPEN(1)

Bus

D

Q

 

VDD

 

 

WR

CK

Q

 

Weak

WPU

 

 

 

 

 

RD

 

GPPU

 

 

 

 

 

 

WPU

 

 

 

 

 

 

Oscillator

 

 

 

Circuit

 

 

D

OSC2

 

VDD

 

Q

 

 

 

 

WR

CK

Q

 

 

GPIO

 

 

 

 

 

 

 

D

Q

 

I/O pin

 

 

 

WR

CK

Q

 

 

TRISIO

 

VSS

RD

 

INTOSC

 

 

 

Mode

 

 

TRISIO

 

 

 

 

RD

 

 

 

(1)

 

 

 

 

GPIO

 

 

 

 

 

D

Q

 

 

WR

CK

Q

D

 

Q

 

 

IOC

 

 

 

 

 

 

 

EN

Q3

RD

 

 

 

 

IOC

 

 

 

 

 

 

Q

D

 

Interrupt-on-

 

EN

 

 

 

 

change

 

 

 

 

 

RD GPIO

 

 

To Timer1 or CLKGEN

 

 

Note 1: Timer1 LP oscillator enabled.

2:When using Timer1 with LP oscillator, the Schmitt Trigger is bypassed.

TABLE 4-1:

 

SUMMARY OF REGISTERS ASSOCIATED WITH GPIO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Value on

Value on

Name

 

 

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

 

Bit 2

Bit 1

Bit 0

all other

 

 

 

POR, BOR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Resets

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ANSEL

 

 

ADCS2

ADCS1

ADCS0

ANS3

 

ANS2

ANS1

ANS0

-000 1111

-000 1111

CCP1CON

 

 

DC1B1

DC1B0

CCP1M3

CCP1M2

CCP1M1

CCP1M0

--00 0000

--00 0000

CMCON0

 

 

COUT

CINV

CIS

 

CM2

 

CM1

 

CM0

-0-0 0000

-0-0 0000

PCON

 

 

ULPWUE

SBOREN

 

 

 

 

 

 

 

 

--0u --uu

 

 

 

 

POR

 

 

BOR

 

--01 --qq

INTCON

 

 

GIE

PEIE

T0IE

INTE

GPIE

 

T0IF

INTF

GPIF

0000 0000

0000 000x

IOC

 

 

IOC5

IOC4

IOC3

 

IOC2

IOC1

IOC0

--00 0000

--00 0000

OPTION_REG

 

 

 

INTEDG

T0CS

T0SE

PSA

 

PS2

 

PS1

 

PS0

 

 

 

GPPU

 

 

 

 

1111 1111

1111 1111

GPIO

 

 

GP5

GP4

GP3

 

GP2

 

GP1

 

GP0

--xx xxxx

--x0 x000

T1CON

 

T1GINV

TMR1GE

T1CKPS1

T1CKPS0

T1OSCEN

 

 

 

TMR1CS

TMR1ON

 

 

 

 

T1SYNC

 

0000 0000

0000 0000

TRISIO

 

 

TRISIO5

TRISIO4

TRISIO3

TRISIO2

TRISIO1

TRISIO0

--11 1111

--11 1111

WPU

 

 

WPU5

WPU4

 

WPU2

WPU1

WPU0

--11 -111

--11 -111

Legend:

x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by GPIO.

 

2007 Microchip Technology Inc.

DS41211D-page 39

PIC12F683

NOTES:

DS41211D-page 40

2007 Microchip Technology Inc.