PIC17C42 Microchip Technology, PIC17C42 Datasheet - Page 57

no-image

PIC17C42

Manufacturer Part Number
PIC17C42
Description
High-Performance 8-Bit CMOS EPROM/ROM Microcontroller
Manufacturer
Microchip Technology
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC17C42-16/JW
Manufacturer:
AD
Quantity:
12
Part Number:
PIC17C42A-16/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC17C42A-16/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-25/P
Manufacturer:
MICROCLOCK
Quantity:
20 000
Example 9-1 shows the instruction sequence to initial-
ize PORTB. The Bank Select Register (BSR) must be
selected to Bank 0 for the port to be initialized.
TABLE 9-3:
TABLE 9-4:
Address
RB0/CAP1
RB1/CAP2
RB2/PWM1
RB3/PWM2
RB4/TCLK12
RB5/TCLK3
RB6
RB7
Legend: ST = Schmitt Trigger input.
12h, Bank 0
11h, Bank 0
10h, Bank 0
06h, Unbanked CPUSTA
07h, Unbanked INTSTA
16h, Bank 1
17h, Bank 1
16h, Bank 3
17h, Bank 3
Legend: x = unknown, u = unchanged, - = unimplemented read as '0', q = Value depends on condition.
Note 1: Other (non power-up) resets include: external reset through MCLR and the Watchdog Timer Reset.
1996 Microchip Technology Inc.
Name
Shaded cells are not used by PORTB.
Name
PORTB
DDRB
PORTA
PIR
PIE
TCON1
TCON2
PORTB FUNCTIONS
REGISTERS/BITS ASSOCIATED WITH PORTB
bit0
bit1
bit2
bit3
bit4
bit5
bit6
bit7
Bit
PORTB data latch
Data direction register for PORTB
CA2OVF CA1OVF PWM2ON PWM1ON CA1/PR3 TMR3ON
CA2ED1 CA2ED0
RBPU
Bit 7
PEIF
RBIF
RBIE
Buffer Type
ST
ST
ST
ST
ST
ST
ST
ST
TMR3IF
TMR3IE
T0CKIF
Bit 6
CA1ED1
TMR2IF
TMR2IE
STKAV
Input/Output or the RB0/CAP1 input pin. Software programmable weak pull-
up and interrupt on change features.
Input/Output or the RB1/CAP2 input pin. Software programmable weak pull-
up and interrupt on change features.
Input/Output or the RB2/PWM1 output pin. Software programmable weak
pull-up and interrupt on change features.
Input/Output or the RB3/PWM2 output pin. Software programmable weak
pull-up and interrupt on change features.
Input/Output or the external clock input to Timer1 and Timer2. Software pro-
grammable weak pull-up and interrupt on change features.
Input/Output or the external clock input to Timer3. Software programmable
weak pull-up and interrupt on change features.
Input/Output pin. Software programmable weak pull-up and interrupt on
change features.
Input/Output pin. Software programmable weak pull-up and interrupt on
change features.
Bit 5
RA5
T0IF
CA1ED0
GLINTD
TMR1IF
TMR1IE
Bit 4
INTF
RA4
CA2IF
CA2IE
PEIE
Bit 3
RA3
T16
TO
EXAMPLE 9-1:
MOVLB 0
CLRF
MOVLW 0xCF
MOVWF DDRB
TMR3CS
T0CKIE
CA1IF
CA1IE
PORTB
Bit 2
RA2
PD
Function
RA1/T0CKI
TMR2ON
TMR2CS
Bit 1
T0IE
TXIF
TXIE
; Select Bank 0
; Initialize PORTB by clearing
;
; Value used to initialize
;
;
;
;
INITIALIZING PORTB
output data latches
data direction
Set RB<3:0> as inputs
RB<5:4> as outputs
RB<7:6> as inputs
TMR1ON 0000 0000 0000 0000
TMR1CS 0000 0000 0000 0000
RA0/INT
INTE
RCIF
RCIE
Bit 0
PIC17C4X
xxxx xxxx uuuu uuuu
1111 1111 1111 1111
0-xx xxxx 0-uu uuuu
--11 11-- --11 qq--
0000 0000 0000 0000
0000 0010 0000 0010
0000 0000 0000 0000
Power-on
Value on
Reset
DS30412C-page 57
Value on all
(Note1)
resets
other

Related parts for PIC17C42