PIC12F683-I/SN Microchip Technology Inc., PIC12F683-I/SN Datasheet - Page 33

no-image

PIC12F683-I/SN

Manufacturer Part Number
PIC12F683-I/SN
Description
8 PIN, 3.5 KB FLASH, 128 RAM, 6 I/O
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC12F683-I/SN

A/d Inputs
4-Channel, 10-Bit
Comparators
1
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Input Output
5
Memory Type
Flash
Number Of Bits
8
Package Type
8-pin SOIC-N
Programmable Memory
3.5K Bytes
Ram Size
128 Bytes
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC12F683-I/SN
Manufacturer:
FREESCALE
Quantity:
2 119
Part Number:
PIC12F683-I/SN
Manufacturer:
Microchip Technology
Quantity:
46 465
Part Number:
PIC12F683-I/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F683-I/SN
Manufacturer:
MICROCHIP
Quantity:
9 460
Part Number:
PIC12F683-I/SN
0
4.0
There are as many as six general purpose I/O pins
available. Depending on which peripherals are
enabled, some or all of the pins may not be available as
general purpose I/O. In general, when a peripheral is
enabled, the associated pin may not be used as a
general purpose I/O pin.
4.1
GPIO is a 6-bit wide, bidirectional port. The
corresponding data direction register is TRISIO.
Setting a TRISIO bit (= 1) will make the corresponding
GPIO pin an input (i.e., put the corresponding output
driver in a High-Impedance mode). Clearing a TRISIO
bit (= 0) will make the corresponding GPIO pin an
output (i.e., put the contents of the output latch on the
selected pin). An exception is GP3, which is input only
and its TRISIO bit will always read as ‘1’. Example 4-1
shows how to initialize GPIO.
Reading the GPIO register reads the status of the pins,
whereas writing to it will write to the PORT latch. All
write operations are read-modify-write operations.
REGISTER 4-1:
© 2006 Microchip Technology Inc.
bit 7
Legend:
R = Readable bit
-n = Value at POR
bit 7-6
bit 5-0
U-0
GPIO PORT
GPIO and the TRISIO Registers
Unimplemented: Read as ‘0’
GP<5:0>: GPIO I/O Pin bit
1 = Port pin is > V
0 = Port pin is < V
U-0
GPIO: GENERAL PURPOSE I/O REGISTER
W = Writable bit
‘1’ = Bit is set
IH
IL
R/W-x
GP5
R/W-0
GP4
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
Therefore, a write to a port implies that the port pins are
read, this value is modified and then written to the
PORT data latch. GP3 reads ‘0’ when MCLRE = 1.
The TRISIO register controls the direction of the GPIO
pins, even when they are being used as analog inputs.
The user must ensure the bits in the TRISIO register
are maintained set when using them as analog inputs.
I/O pins configured as analog input always read ‘0’.
EXAMPLE 4-1:
GP3
R-x
Note:
BANKSEL GPIO
CLRF
MOVLW
MOVWF
BANKSEL ANSEL
CLRF
MOVLW
MOVWF
The ANSEL and CMCON0 registers must
be initialized to configure an analog
channel as a digital input. Pins configured
as analog inputs will read ‘0’.
GPIO
07h
CMCON0
ANSEL
0Ch
TRISIO
R/W-0
GP2
INITIALIZING GPIO
;
;Init GPIO
;Set GP<2:0> to
;digital I/O
;
;digital I/O
;Set GP<3:2> as inputs
;and set GP<5:4,1:0>
;as outputs
x = Bit is unknown
PIC12F683
R/W-0
GP1
DS41211C-page 31
R/W-0
GP0
bit 0

Related parts for PIC12F683-I/SN