PIC18C658 MICROCHIP [Microchip Technology], PIC18C658 Datasheet - Page 101

no-image

PIC18C658

Manufacturer Part Number
PIC18C658
Description
High-Performance Microcontrollers with CAN Module
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18C658-1/CL
Manufacturer:
Microchip
Quantity:
6
Part Number:
PIC18C658-1/L
Manufacturer:
Microchip
Quantity:
6
Part Number:
PIC18C658-E/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC18C658-E/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC18C658-ES
Manufacturer:
Microchip
Quantity:
131
Part Number:
PIC18C658-I/L
Manufacturer:
Microchip
Quantity:
385
Part Number:
PIC18C658-I/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC18C658-I/L
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18C658-I/PT
Manufacturer:
Microchip
Quantity:
601
Part Number:
PIC18C658-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC18C658T-E/L
Manufacturer:
Microchip Technology
Quantity:
10 000
8.7
PORTG is a 5-bit wide, bi-directional port. The corre-
sponding Data Direction register is TRISG. Setting a
TRISG bit (=1) will make the corresponding PORTG pin
an input (i.e., put the corresponding output driver in a
hi-impedance mode). Clearing a TRISG bit (=0) will
make the corresponding PORTG pin an output (i.e., put
the contents of the output latch on the selected pin).
Read-modify-write operations on the LATG register
read and write the latched output value for PORTG.
Pins RG0-RG2 on PORTG are multiplexed with the
CAN peripheral. Refer to "CAN Module", Section 17.0
for proper settings of TRISG when CAN is enabled.
FIGURE 8-12: RG0/CANTX0 PIN BLOCK DIAGRAM
 2000 Microchip Technology Inc.
Note:
Data Bus
WR PORTG or
WR LATG
WR TRISG
RD TRISG
RD PORTG
PORTG, LATG, and TRISG Registers
TXD
I/O pins have diode protection to V
TRIS Latch
Data
RD LATG
D
D
CK
CK
Latch
Q
Q
Q
Q
DD
Advanced Information
and V
SS
.
0
1
OPMODE2:OPMODE0 = 000
EXAMPLE 8-7:
CLRF
CLRF
MOVLW
MOVWF
Q
PORTG
LATG
0x04
TRISG
EN
EN
D
V
V
P
N
INITIALIZING PORTG
SS
DD
; Initialize PORTG by
; clearing output
; data latches
; Alternate method
; to clear output
; data latches
; Value used to
; initialize data
; direction
; Set RG1:RG0 as outputs
; RG2 as input
; RG4:RG3 as outputs
PIC18CXX8
ENDRHI
OPMODE2:OPMODE0=000
Schmitt
Trigger
DS30475A-page 101
I/O Pin

Related parts for PIC18C658