This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C EPI-FPGA Interfcae Interrupt



Hello,

I am using FPI GP mode to read andd write to fpga.

With out interrupt i am able to access the data from fpga,but when we tried using  interrupt its not reading data from fpga  we probed the controller pin and is showing interrupts in the pins

1)configuration of Interrupt Controller detect falling edge of interrupt from fpga

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);

GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_0);
GPIOPadConfigSet(GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD);
GPIOIntTypeSet(GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_FALLING_EDGE );
GPIOIntEnable(GPIO_PORTD_BASE, GPIO_INT_PIN_0);

IntEnable(INT_GPIOD);

IntMasterEnable();

2) Interrupt Handler Program

void GPIODIntHandler(void)
{

UARTprintf("!!!!!! INTERRUPT !!!!!!!! \n ");
GPIOIntClear(GPIO_PORTD_BASE, GPIO_PIN_0);

flag=flag+1;

}

Start up configuration file configuration also made 

If any  thing missing in configuratiomn plese replay,FPGA CLOCK IS 20 MHZ

 

 

Regards,

Krishnan

  • Hello Krishnan

    When you mentioned that you are probing the controller pins and it is showing the interrupt: where does it show the interrupt. In the GPIOMIS register?

    Also please take a register dump of the GPIO registers for us to examine.

    Last but not the least, is the GPIO Pin change from FPGA like a pulse of 20MHz or is it a steady state and what is the system clock frequency on TM4C device?

    Regards
    Amit
  • Hello,

    We are probing the controller ic pin whic we configured as interrupt pin(Port D pin 0) IC PIN -1 of microcontroller.WHEN WE ARE PROBING THIS PIN WE ARE GETTING INTERRUPT ON OSCILLOSCOPE .

    I have not used gpiomis register

    FPGA CLOCK IS SET TO 20Mhz for EPI-FPGA DATA TRANSFER

    Controller clock for EPI interface is 60Mhz and controller clock is default.

    Interrut pulse widh from FPGA 30 NANO SECOND

    Sir,Register Dump i cant understand,i am attaching my register configurations for GPIO Interrupt pin and i am attaching my entire project as zip also.......

    GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_0);
    GPIOPadConfigSet(GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD);
    GPIOIntTypeSet(GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_FALLING_EDGE );
    GPIOIntEnable(GPIO_PORTD_BASE, GPIO_INT_PIN_0);
    GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_PIN_0 );
    IntEnable(INT_GPIOD);

     

    void GPIODIntHandler(void)
    {

    UARTprintf("!!!!!! INTERRUPT !!!!!!!! \n ");
    GPIOIntClear(GPIO_PORTD_BASE, GPIO_PIN_0);

    flag=flag+1;
    UARTprintf("flag %d \n ",flag);
    unsigned short *cptr;
    unsigned int loop = 0;
    cptr = (unsigned short *)0xC0000000;
    //int j;
    while(loop <=40)
    {

    bval[loop] = *cptr;

    UARTprintf("Address of var1 variable: %x \t", cptr );
    UARTprintf("VALUE OF CPTR: %d\t loop val = %d",cval , loop );
    cptr++;
    loop++;

    // for(j = 0;j < 0x10000;j++)
    // {
    // UARTprintf("%d",j);
    // }

    UARTprintf("\n");

    }
    }

     

    Any Clarifications required plese inform.

    Regards,

    Krishnanenet_io.rar

  • Hello Krishnan,

    First of all the following two calls are not required, since you have configured it as a GPIO Input

    GPIOPadConfigSet(GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD);
    GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_0, GPIO_PIN_0 );

    Secondly, in the register window, check the GPIO Port D registers in the address space of 0x400-0x600 as to how they are configured. Now toggle the GPIO Port D Pin 0 by connecting it to 3.3V and then GND (to generate a falling edge) and then see if the GPIOMIS register bit for Pin-0 gets set or not. This will tell you if the code configuration is correct and if the pulse from the FPGA is not wide enough to be registered.

    Also set a breakpoint when doing the manual toggle and then see if that on a manual toggle does the breakpoint get activated which will tell you if the mapping is correct.

    Regards,
    Amit
  • Hello,

    our issues are solved in interrupts actually i the problem was in startup_ccs "nmi interrupt handler" contineous while loop...........


    Thank you ,
    Regards,
    Krishnan
  • Hello Krishnan

    How come NMI was getting triggered. NMI function is only available on PD7 and PF0 while your code is using PD0?

    Regards
    Amit
  • Hello,

    I also confirmed its not NMI issue by running NMI interrupt handler as it is in start up ccs.

    How we tested the interrupt is we connected an external switch in one pin of controller and identify the trigger as an interrupt.In interrupt handler we made toggle for 5 times if it detect an edge on a gpio pin

    (i got this from

    )

    Then we found the interrupt is working properly in controller,mean while we removed the while(1) loops in ccs start up files. we checked then by 1,2,3 interrupts fron fpga.

    Later i confirmed what u replied again by giving while (1) in NMI Interrupt handler,its not the issue,but in configurations i dont made any other changes, i am also exploring if i get relevent information i will share.

    Thankyou ,AMIT

    Regards,

    Krishnan