English
Language : 

PIC18F2331 Datasheet, PDF (189/396 Pages) Microchip Technology – 28/40/44-Pin Enhanced Flash Microcontrollers with nanoWatt Technology, High Performance PWM and A/D
PIC18F2331/2431/4331/4431
REGISTER 17-3:
PWMCON0: PWM CONTROL REGISTER 0
U-0
R/W-1(1) R/W-1(1) R/W-1(1) R/W-0
—
PWMEN2 PWMEN1 PWMEN0 PMOD3(3)
R/W-0
PMOD2
R/W-0
PMOD1
R/W-0
PMOD0
bit 7
bit 0
bit 7
bit 6-4
Unimplemented: Read as ‘0’.
PWMEN2:PWMEN0: PWM Module Enable bits(1)
111 =All odd PWM I/O pins enabled for PWM output(2).
110 =PWM1, PWM3 pins enabled for PWM output.
101 =All PWM I/O pins enabled for PWM output(2) .
100 =PWM0, PWM1, PWM2, PWM3, PWM4 and PWM5 pins enabled for PWM output.
011 =PWM0, PWM1, PWM2 and PWM3 I/O pins enabled for PWM output.
010 =PWM0 and PWM1 pins enabled for PWM output.
001 =PWM1 pin is enabled for PWM output.
000 =PWM module disabled. All PWM I/O pins are general purpose I/O.
bit 3-0
PMOD3:PMOD0: PWM Output Pair Mode bits
For PMOD0:
1 = PWM I/O pin pair (PWM0, PWM1) is in the Independent mode.
0 = PWM I/O pin pair (PWM0, PWM1) is in the Complementary mode.
For PMOD1:
1 = PWM I/O pin pair (PWM2, PWM3) is in the Independent mode.
0 = PWM I/O pin pair (PWM2, PWM3) is in the Complementary mode.
For PMOD2:
1 = PWM I/O pin pair (PWM4, PWM5) is in the Independent mode.
0 = PWM I/O pin pair (PWM4, PWM5) is in the Complementary mode.
For PMOD3(3):
1 = PWM I/O pin pair (PWM6, PWM7) is in the Independent mode.
0 = PWM I/O pin pair (PWM6, PWM7) is in the Complementary mode.
Note 1: Reset condition of PWMEN bits depends on PWMPIN device configuration bit.
2: When PWMEN2:PWMEN0 = 101, PWM[5:0] outputs are enabled for
PIC18F2X31 devices; PWM[7:0] outputs are enabled for PIC18F4X31devices.
When PWMEN2:PWMEN0 = 111, PWM outputs 1, 3 and 5 are enabled in
PIC18F2X31devices; PWM outputs 1, 3, 5 and 7 are enabled in PIC18F4X31
devices.
3: Unimplemented in PIC18F2X31 devices; maintain these bits clear.
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = bit is cleared x = bit is unknown
 2003 Microchip Technology Inc.
Preliminary
DS39616B-page 187