void main(void)
{
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
InitFlash();
//
// Initialize device clock and peripherals
//
InitSysCtrl();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
InitGpio();
EALLOW;
GpioCtrlRegs.GPHAMSEL.bit.GPIO230=0;
GpioCtrlRegs.GPHGMUX1.bit.GPIO230=0;
GpioCtrlRegs.GPHMUX1.bit.GPIO230=0;
GpioCtrlRegs.GPHDIR.bit.GPIO230=0;
GpioCtrlRegs.GPHPUD.bit.GPIO230=0;
// AnalogSubsysRegs.AGPIOCTRLH.bit.GPIO230=0;
// GpioCtrlRegs.GPHLOCK.bit.GPIO230=1;
//
GpioCtrlRegs.GPHAMSEL.bit.GPIO227=0;
GpioCtrlRegs.GPHGMUX1.bit.GPIO227=0;
GpioCtrlRegs.GPHMUX1.bit.GPIO227=0;
GpioCtrlRegs.GPHDIR.bit.GPIO227=0;
GpioCtrlRegs.GPHPUD.bit.GPIO227=0;
// AnalogSubsysRegs.AGPIOCTRLH.bit.GPIO227=0;
// GpioCtrlRegs.GPHLOCK.bit.GPIO227=1;
//
GpioCtrlRegs.GPHAMSEL.bit.GPIO224=0;
GpioCtrlRegs.GPHGMUX1.bit.GPIO224=0;
GpioCtrlRegs.GPHMUX1.bit.GPIO224=0;
GpioCtrlRegs.GPHDIR.bit.GPIO224=0;
GpioCtrlRegs.GPHPUD.bit.GPIO224=0;
// AnalogSubsysRegs.AGPIOCTRLH.bit.GPIO224=0;
// GpioCtrlRegs.GPHLOCK.bit.GPIO224=1;
EDIS;
//
InitEPwmGpio();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
InitPieVectTable();
// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.EPWM1_INT = &MainISR;
//PieVectTable.TINT0 = &cpu_timer0_isr;
EDIS; // This is needed to disable write to EALLOW protected registers
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
InitEPWM();
pwm_disable();
EALLOW;
SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1;
EDIS;
// Enable CPU INT3 which is connected to EPWM1-3 INT:
IER |= M_INT3;
// Enable EPWM INTn in the PIE: Group 3 interrupt 1-3
PieCtrlRegs.PIEIER3.bit.INTx1 = 1;
// Enable global Interrupts and higher priority real-time debug events:
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
//
// Loop Forever
//
for(;;)
{
//
// Delay for a bit.
//
DELAY_US(500000);
}
}
When I initialize AGPIO pins 224, 227, and 230, especially when initializing the AMSEL register, PWM interrupts cannot enter, but the input status of the relevant pins can be identified. When I only block the AMSEL register and everything else remains unchanged, PWM interrupts can enter normally, but the input status on AGPIO cannot be read.