Vault 7: Projects

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

PIC24F Family Reference Manual
DS39735A-page 47-36 Preliminary © 2010 Microchip Technology Inc.
Example 47-3: Dead-Time Insertion (Complementary PWM Output Mode Only)
Example 47-4: MCPWM Module I/O Pin Control
Example 47-5: MCPWM Module Duty Cycle Initialization
Example 47-6: Enabling PWM Pulse Generation
/* Clock period for Dead Time Unit A is Tcy */
/* Clock period for Dead Time Unit B is Tcy */
P1DTCON1bits.DTAPS = 0b00;
P1DTCON1bits.DTBPS = 0b00;
/* Dead time value for Dead Time Unit A */
/* Dead time value for Dead Time Unit B */
P1DTCON1bits.DTA = 10;
P1DTCON1bits.DTB = 20;
/* Dead Time Unit selection for PWM signals */
/* Dead Time Unit A selected for PWM active transitions */
/* Dead Time Unit B selected for PWM inactive transitions */
P1DTCON2bits.DTS3A = 0;
P1DTCON2bits.DTS2A = 0;
P1DTCON2bits.DTS1A = 0;
P1DTCON2bits.DTS3I = 1;
P1DTCON2bits.DTS2I = 1;
P1DTCON2bits.DTS1I = 1;
/* PWM I/O pin controlled by PWM Generator */
P1OVDCONbits.POVD3H = 1;
P1OVDCONbits.POVD2H = 1;
P1OVDCONbits.POVD1H = 1;
P1OVDCONbits.POVD3L = 1;
P1OVDCONbits.POVD2L = 1;
P1OVDCONbits.POVD1L = 1;
/* Initialize duty cycle values for PWM1, PWM2 and PWM3 signals */
P1DC1 = 200;
P1DC2 = 200;
P1DC3 = 200;
P1TCONbits.PTEN = 1;

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh