|
PIC18F25K20T-ISS Datasheet, PDF (183/456 Pages) Microchip Technology – 28/40/44-Pin Flash Microcontrollers with nanoWatt XLP Technology | |||
|
◁ |
PIC18F2XK20/4XK20
16.4.4 ENHANCED PWM
AUTO-SHUTDOWN MODE
The PWM mode supports an Auto-Shutdown mode that
will disable the PWM outputs when an external
shutdown event occurs. Auto-Shutdown mode places
the PWM output pins into a predetermined state. This
mode is used to help prevent the PWM from damaging
the application.
The auto-shutdown sources are selected using the
ECCPAS<2:0> bits of the ECCP1AS register. A
shutdown event may be generated by:
⢠A logic â0â on the FLT0 pin
⢠Comparator C1
⢠Comparator C2
⢠Setting the ECCPASE bit in firmware
A shutdown condition is indicated by the ECCPASE
(Auto-Shutdown Event Status) bit of the ECCP1AS
register. If the bit is a â0â, the PWM pins are operating
normally. If the bit is a â1â, the PWM outputs are in the
shutdown state.
When a shutdown event occurs, two things happen:
The ECCPASE bit is set to â1â. The ECCPASE will
remain set until cleared in firmware or an auto-restart
occurs (see Section 16.4.5 âAuto-Restart Modeâ).
The enabled PWM pins are asynchronously placed in
their shutdown states. The PWM output pins are
grouped into pairs [P1A/P1C] and [P1B/P1D]. The state
of each pin pair is determined by the PSSAC and
PSSBD bits of the ECCP1AS register. Each pin pair may
be placed into one of three states:
⢠Drive logic â1â
⢠Drive logic â0â
⢠Tri-state (high-impedance)
REGISTER 16-2: ECCP1AS: ENHANCED CAPTURE/COMPARE/PWM AUTO-SHUTDOWN
CONTROL REGISTER
R/W-0
ECCPASE
bit 7
R/W-0
ECCPAS2
R/W-0
ECCPAS1
R/W-0
ECCPAS0
R/W-0
PSSAC1
R/W-0
PSSAC0
R/W-0
PSSBD1
R/W-0
PSSBD0
bit 0
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
bit 7
bit 6-4
bit 3-2
bit 1-0
ECCPASE: ECCP Auto-Shutdown Event Status bit
1 = A shutdown event has occurred; ECCP outputs are in shutdown state
0 = ECCP outputs are operating
ECCPAS<2:0>: ECCP Auto-shutdown Source Select bits
000 = Auto-Shutdown is disabled
001 = Comparator C1OUT output is high
010 = Comparator C2OUT output is high
011 = Either Comparator C1OUT or C2OUT is high
100 = VIL on FLT0 pin
101 = VIL on FLT0 pin or Comparator C1OUT output is high
110 = VIL on FLT0 pin or Comparator C2OUT output is high
111 = VIL on FLT0 pin or Comparator C1OUT or Comparator C2OUT is high
PSSACn: Pins P1A and P1C Shutdown State Control bits
00 = Drive pins P1A and P1C to â0â
01 = Drive pins P1A and P1C to â1â
1x = Pins P1A and P1C tri-state
PSSBDn: Pins P1B and P1D Shutdown State Control bits
00 = Drive pins P1B and P1D to â0â
01 = Drive pins P1B and P1D to â1â
1x = Pins P1B and P1D tri-state
ï£ 2010 Microchip Technology Inc.
DS41303G-page 183
|
▷ |