adding final configuration

lecture
Gerardo Marx 3 hours ago
parent 85a774914c
commit 81557b1767

@ -319,9 +319,27 @@ void main(void)
EPwm2Regs. AQCTLA.bit.CAU = 1; EPwm2Regs. AQCTLA.bit.CAU = 1;
EPwm2Regs. AQCTLB.bit.CAU = 2; EPwm2Regs. AQCTLB.bit.CAU = 2;
// 7. Configure event triggers and trip zones. // 7. Configure event triggers and trip zones.
// GPIO Muxed Pins table
// Configure GPIO0 to GPIO3 as ePWM functionality
EALLOW;
GpioCtr1Regs.GPAGMUX1.bit.GPI00 = 0;
GpioCtr1Regs.GPAGMUX1.bit.GPI01 = 0;
GpioCtr1Regs.GPAGMUX1.bit.GPI02 = 0;
GpioCtr1Regs.GPAGMUX1.bit.GPI03 = 0;
GpioCtrIRegs.GPAMUX1.bit.GPI00 = 1;
GpioCtr1Regs.GPAMUX1.bit.GPI01 = 1;
GpioCtr1Regs.GPAMUX1.bit.GPI02 = 1;
GpioCtriRegs. GPAMUX1.bit.GPI03 = 1;
EDIS;
// 8. Register and enable interrupts. // 8. Register and enable interrupts.
// 9. Configure PWM GPIOs, diagnostic pins, and X-BAR. // 9. Configure PWM GPIOs, diagnostic pins, and X-BAR.
// 10. Confirm fault conditions and synchronize startup. // 10. Confirm fault conditions and synchronize startup.
// Start the timer counters for ePWM 1 and 2
EALLOW;
EDIS;
CpuSysRegs.PCLKCRO.bit.
for (;;) {} for (;;) {}
} }

Loading…
Cancel
Save