Dear all,
I'm trying to use GPIO3 edge rising detect to trigger an interrupt and using DMTimer3 to call a function 0.1 microseconds in EtherCATproject.
I've followed those discussion below:
1. http://e2e.ti.com/support/arm/sitara_arm/f/791/p/194331/695180.aspx#695180
2. https://e2e.ti.com/support/embedded/tirtos/f/355/t/270912
Hwi_Params hwiParams;
Hwi_Handle myGPIOHwi;
Error_Block eb;
Error_init(&eb);
Hwi_Params_init(&hwiParams);
hwiParams.priority = 3;
hwiParams.arg = 62;
hwiParams.enableInt = FALSE;
/*62 int number-->GPIO3*/
myGPIOHwi = Hwi_create(62, GPIO_Isr, &hwiParams, &eb);
Hwi_enableInterrupt(62); //SOC_GPIO_3_REGS
if (myGPIOHwi == NULL)
{
System_abort("Hwi create failed");
}
/*DMTimer initial*/
Timer_Params timerParams;
Timer_Handle myTimer;
DMTimer3ModuleClkConfig();
Timer_Params_init(&timerParams);
timerParams.period = 0.1;/*0.1 ms*/
timerParams.periodType = Timer_PeriodType_MICROSECS;
timerParams.arg = 1;
timerParams.extFreq.lo = 320000000;//32MHz
timerParams.extFreq.hi = 0;
myTimer = Timer_create(1, DMTimerIsr, &timerParams, NULL); /* DMTIMER3 */
if (myTimer == NULL)
{
System_abort("Timer create failed");
}
/*The setup called from other .c file which I cooked it*/
DMTimerSetUp();
GPIOset();
Void Teninttask(UArg arg0, UArg arg1)
{
while(1)
{
//GPIOPinIntEnable(GPIO_INSTANCE_ADDRESS,GPIO_INT_LINE_1,19);
DMTimerIntEnable(SOC_DMTIMER_3_REGS, DMTIMER_INT_MAT_EN_FLAG | DMTIMER_INT_OVF_EN_FLAG);
DMTimerEnable(SOC_DMTIMER_3_REGS);
while(GPIOflagIsr == 0);
{
for(i = 1; i <= 10; i++)
{
while(DMTimerflagIsr == 0);
GPIOPinWrite(GPIO_INSTANCE_ADDRESS,20,GPIO_PIN_HIGH);
Delay(0xF);
GPIOPinWrite(GPIO_INSTANCE_ADDRESS,20,GPIO_PIN_LOW);
DMTimerIntEnable(DMTIMER_INSTANCE,DMTIMER_INT_MAT_EN_FLAG | DMTIMER_INT_OVF_EN_FLAG);
DMTimerflagIsr == 0;
}
GPIOflagIsr == 0;
}
}
}
At the result the program always hang on "while(GPIOflagIsr == 0);" seems it doesn's go in to the GPIO_isr.
The register is worked great.
The few questions below:
ØAre theose two initial way correct if yes why the function does'n get into isr? by the way, I've put the signal in to my input pin to trigger the gpio interrupt occur.
Thanks,
Tyler