|
PIC18F44J50-I Datasheet, PDF (261/562 Pages) Microchip Technology – 28/44-Pin, Low-Power, High-Performance USB Microcontrollers | |||
|
◁ |
PIC18F46J50 FAMILY
18.5.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
ECCPxAS<2:0> bits of the ECCPxAS register. A
shutdown event may be generated by:
⢠A logic â0â on the pin that is assigned the FLT0
input function
⢠Comparator C1
⢠Comparator C2
⢠Setting the ECCPxASE bit in firmware
A shutdown condition is indicated by the ECCPxASE
(Auto-Shutdown Event Status) bit of the ECCPxAS
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 ECCPxASE bit is set to â1â. The ECCPxASE will
remain set until cleared in firmware or an auto-restart
occurs (see Section 18.5.5 âAuto-Restart Modeâ).
The enabled PWM pins are asynchronously placed in
their shutdown states. The PWM output pins are
grouped into pairs, [PxA/PxC] and [PxB/PxD]. The state
of each pin pair is determined by the PSSxAC and
PSSxBD bits of the ECCPxAS register. Each pin pair
may be placed into one of three states:
⢠Drive logic â1â
⢠Drive logic â0â
⢠Tri-state (high-impedance)
REGISTER 18-2: ECCPxAS: ECCPx AUTO-SHUTDOWN CONTROL REGISTER
(ACCESS FBEh, FB8h)
R/W-0
ECCPxASE
bit 7
R/W-0
R/W-0
R/W-0
ECCPxAS2 ECCPxAS1 ECCPxAS0
R/W-0
PSSxAC1
R/W-0
PSSxAC0
R/W-0
PSSxBD1
R/W-0
PSSxBD0
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
ECCPxASE: ECCP Auto-Shutdown Event Status bit
1 = A shutdown event has occurred; ECCP outputs are in a shutdown state
0 = ECCP outputs are operating
ECCPxAS<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
PSSxAC<1:0>: Pins PxA and PxC Shutdown State Control bits
00 = Drive PxA and PxC pins to â0â
01 = Drive PxA and PxC pins to â1â
1x = PxA and PxC pins tri-state
PSSxBD<1:0>: Pins PxB and PxD Shutdown State Control bits
00 = Drive PxB and PxD pins to â0â
01 = Drive PxB and PxD pins to â1â
1x = PxB and PxD pins tri-state
Note 1: The auto-shutdown condition is a level-based signal, not an edge-based signal. As long as the level is
present, the auto-shutdown will persist.
2: Writing to the ECCPxASE bit is disabled while an auto-shutdown condition persists.
3: Once the auto-shutdown condition has been removed and the PWM restarted (either through firmware or
auto-restart), the PWM signal will always restart at the beginning of the next PWM period.
ï£ 2011 Microchip Technology Inc.
DS39931D-page 261
|
▷ |