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.

F28335 External interrupt activation using SIMULINK

Hi

I'm new in working with 28335 kit. I have performed a number of projects but I still can't activate the external interrupt.

So, my question is how to assign a certain GPIO to work as an external interrupt pin using SIMULINK??

thank you

  • khaled maher said:

    Hi

    I'm new in working with 28335 kit. I have performed a number of projects but I still can't activate the external interrupt.

    So, my question is how to assign a certain GPIO to work as an external interrupt pin using SIMULINK??

    thank you

    Hi Khaled,

    The mathworks folks often post here, but to expidite your question you can email c2000_expert@mathworks.com and reference your post here.

    Best regards
    Lori

  • I have sent my question to c2000_expert@mathworks.com but I didn't get any response.

    So, any other suggestion.

    Thank you

  • I've personally sent an email to their support guys, so hopefully you get a response tomorrow.

  • This was the response from Mathworks

    Unfortunately, the Target Support Package reserves the GPIO pins  for DMA support on the 28335, so, out of the box, it is not possible to reassign the GPIOs as interrupts.

     

    It is possible, however, to manually write some custom code to reassign the pins, but that would require manual editing of the generated code.

     

    E.g.,  following code lines show how to use GPIO pin 26 for external interrupt 2, which can be retrieved by Simulink Hardware Interrupt block.

     

       // Make GPIO26 the input source for XINT2

       GpioCtrlRegs.GPAMUX2.bit.GPIO26 = 0;  // GPIO26 = GPIO26

       GpioCtrlRegs.GPADIR.bit.GPIO26 = 0;   // GPIO26 = input

       GpioIntRegs.GPIOXINT2SEL.all = 26;    // XINT2 connected to GPIO26

     

    You may add similar lines into init_board() from the generated code.

     

    For details, see TI’s document SPRS439G, page 102, for setting up External Interrupt input through GPIO pins.

  • It works.

    Thank you all for your help.

    But in the future, Should I Post my question here os send it directly to the mentioned email??

     

  • The best route would be to post here and send that link to the email list.  That way it could be answered here for others to benefit from. 

  • Hello,
    I have been hoping to make a GPIO pin an interrupt for some time and this seems like it is exactly what I need. However, I have a few questions about the specifics of doing so. 

    Does it matter that I am using an F28069M? Or are the lines of code the same?

    Could you tell me where exactly I should insert this code within the init_board()? Or does it not really matter?

    How exactly do I go about editing the code? I know that I could open it in CCS and inser the lines, but would I need to do anything to the .out file that is generated by simulink or does it simply reference the files?

    Thanks for the help!
    -eric