| Electronic Components Datasheet Search |
|
PIC16F87X Datasheet(PDF) 33 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC16F87X Datasheet(HTML) 33 Page - Microchip Technology |
|
33 / 200 page ![]() PIC16F87X © 1998 Microchip Technology Inc. Preliminary DS30292A-page 33 3.3 PORTC and the TRISC Register PORTC is an 8-bit wide bi-directional port. The corre- sponding data direction register is TRISC. Setting a TRISC bit (=1) will make the corresponding PORTC pin an input, i.e., put the corresponding output driver in a hi-impedance mode. Clearing a TRISC bit (=0) will make the corresponding PORTC pin an output, i.e., put the contents of the output latch on the selected pin. PORTC is multiplexed with several peripheral functions (Table 3-5). PORTC pins have Schmitt Trigger input buffers. When the I2C module is enabled, the PORTC (3:4) pins can be configured with normal I2C levels or with SMBUS levels by using the CKE bit (SSPSTAT <6>). 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 3-1: INITIALIZING PORTC BCF STATUS, RP0 ; Select Bank 0 CLRF PORTC ; Initialize PORTC by ; clearing output ; data latches BSF STATUS, RP0 ; Select Bank 1 MOVLW 0xCF ; Value used to ; initialize data ; direction MOVWF TRISC ; Set RC<3:0> as inputs ; RC<5:4> as outputs ; RC<7:6> as inputs FIGURE 3-5: PORTC BLOCK DIAGRAM (PERIPHERAL OUTPUT OVERRIDE) RC<0:2> RC<5:7> FIGURE 3-6: PORTC BLOCK DIAGRAM (PERIPHERAL OUTPUT OVERRIDE) RC<3:4> PORT/PERIPHERAL Select(2) Data bus WR PORT WR TRIS RD Data Latch TRIS Latch RD TRIS Schmitt Trigger Q D Q CK Q D EN Peripheral Data Out 0 1 Q D Q CK P N VDD VSS PORT Peripheral OE(3) Peripheral input I/O pin(1) Note 1: I/O pins have diode protection to VDD and VSS. 2: Port/Peripheral select signal selects between port data and peripheral output. 3: Peripheral OE (output enable) is only activated if peripheral select is active. PORT/PERIPHERAL Select(2) Data bus WR PORT WR TRIS RD Data Latch TRIS Latch RD TRIS Schmitt Trigger Q D Q CK Q D EN Peripheral Data Out 0 1 Q D Q CK P N VDD VSS PORT Peripheral OE(3) SSPl input I/O pin(1) Note 1: I/O pins have diode protection to VDD and VSS. 2: Port/Peripheral select signal selects between port data and peripheral output. 3: Peripheral OE (output enable) is only activated if peripheral select is active. 0 1 CKE SSPSTAT<6> Schmitt Trigger with SMBus levels |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |