# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# PIC24FJ32MC10X -- Motor Control PWM

- 1
- 2
…
- 28
- 29
- 30
- 31
- 32
…
- 49
- 50

PIC24F Family Reference Manual
DS39735A-page 47-30 Preliminary © 2010 Microchip Technology Inc.
47.10.1 Immediate Update of PWM Duty Cycle
The Immediate Update Enable (IUE) bit in PWM Control Register 2 (PWMxCON2<2>) provides
an option for updating the duty cycle values immediately after a write to the duty cycle registers.
This feature eliminates waiting for the end of the time base period to update the duty cycle
values. If the IUE bit is set, an immediate update of the duty cycle is enabled. If the bit is cleared,
immediate update of the duty cycle is disabled. The following three cases are possible when
immediate update is enabled:
 Case 1: If the PWM output is active at the time the new duty cycle is written, and the new
duty cycle is greater than the current time base value, the PWM pulse width is lengthened.
 Case 2: If the PWM output is active at the time the new duty cycle is written, and the new
duty cycle is less than the current time base value, the PWM pulse width is shortened.
 Case 3: If the PWM output is inactive at the time the new duty cycle is written, and the new
duty cycle is greater than the current time base value, the PWM output becomes active
immediately and remains active for the newly written duty cycle value.
Figure 47-14 shows the above mentioned cases.
Figure 47-14: Duty Cycle Update Times When Immediate Updates are Enabled (IUE = 1)
50%
90% 10% 90%
Latest Duty Cycle
Value Written
PWM Output
PxTMR Value
to PxDC3:PxDC1
New Values Written to PxDC3:PxDC1 Register
Case 1
Case 2
Case 3

- 1
- 2
…
- 28
- 29
- 30
- 31
- 32
…
- 49
- 50