datasheetbank_Logo
数据手册搜索引擎和 Datasheet免费下载 PDF

PIC16LC926-SL 查看數據表(PDF) - Microchip Technology

零件编号
产品描述 (功能)
生产厂家
PIC16LC926-SL
Microchip
Microchip Technology 
PIC16LC926-SL Datasheet PDF : 182 Pages
First Prev 31 32 33 34 35 36 37 38 39 40 Next Last
PIC16C925/926
4.3 PORTC and TRISC Register
PORTC is a 6-bit, bi-directional port. Each pin is individ-
ually configurable as an input or output through the
TRISC register. PORTC is multiplexed with several
peripheral functions (Table 4-5). PORTC pins have
Schmitt Trigger input buffers.
When enabling peripheral functions, care should be
taken in defining TRIS bits for each PORTC pin. Some
peripherals override the TRIS bit to make a pin an out-
put, while other peripherals override the TRIS bit to
make a pin an input. Since the TRIS bit override is in
effect while the peripheral is enabled, read-
modify-write instructions (BSF, BCF, XORWF) with
TRISC as destination should be avoided. The user
should refer to the corresponding peripheral section for
the correct TRIS bit settings.
EXAMPLE 4-3: INITIALIZING PORTC
BCF STATUS,RP0 ; Select Bank0
BCF STATUS,RP1
CLRF PORTC
; Initialize PORTC
BSF STATUS,RP0 ; Select Bank1
MOVLW 0xCF
; Value used to
; initialize data
; direction
MOVWF TRISC
; Set RC<3:0> as inputs
; RC<5:4> as outputs
; RC<7:6> always read 0
FIGURE 4-5:
RBPU(2)
Data Bus
WR Port
PORTC BLOCK DIAGRAM
(PERIPHERAL OUTPUT
OVERRIDE)
VDD
Data Latch
DQ
CK
P
Weak
Pull-up
I/O
pin(1)
WR TRIS
TRIS Latch
DQ
CK
TTL
Input
Buffer
RD TRIS
RD Port
QD
EN
RB0/INT
Schmitt Trigger
Buffer
RD Port
Note 1: I/O pins have diode protection to VDD and VSS.
2: To enable weak pull-ups, set the appropriate TRIS
bit(s) and clear the RBPU bit (OPTION<7>).
TABLE 4-5: PORTC FUNCTIONS
Name
RC0/T1OSO/T1CKI
RC1/T1OSI
RC2/CCP1
RC3/SCK/SCL
Bit# Buffer Type
bit0
ST
bit1
ST
bit2
ST
bit3
ST
RC4/SDI/SDA
bit4
ST
RC5/SDO
bit5
ST
Legend: ST = Schmitt Trigger input
Function
Input/output port pin or Timer1 oscillator output or Timer1 clock input.
Input/output port pin or Timer1 oscillator input.
Input/output port pin or Capture input/Compare output/PWM output.
Input/output port pin or the synchronous serial clock for both SPI and
I2C modes.
Input/output port pin or the SPI Data In (SPI mode) or data I/O
(I2C mode).
Input/output port pin or Synchronous Serial Port data out.
TABLE 4-6: SUMMARY OF REGISTERS ASSOCIATED WITH PORTC
Address Name Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
Power-on
Reset
Value on all
other
RESETS
07h
PORTC
RC5 RC4 RC3 RC2 RC1 RC0 --xx xxxx
87h
TRISC
PORTC Data Direction Control Register
--11 1111
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used by PORTC.
--uu uuuu
--11 1111
2001 Microchip Technology Inc.
Preliminary
DS39544A-page 33

Share Link: 

datasheetbank.com [ Privacy Policy ] [ Request Datasheet ] [ Contact Us ]