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.

Capture External Interrupt to GPIO3_6 on AM3358 Starter Kit ?????

Other Parts Discussed in Thread: AM3358

Hello

I am trying to capture an external interrupt to pin GPIO3_6 pin at rising edge to ISR . I am not been able to capture the interrupt to ISR. Below is my code for the initialisation of interrupt on AM3358 Starter Kit.. Please tell me why i am not been able to capture interrupt,where i am wrong...

void CPUirqe()

{

asm( " dsb   \n\t"

         " mrs  r0, CPSR\n\t"

         " bic    r0,0x#80\n\t"

         " msr  CPSR,r0");

}

void IntMasterIRQEnable()

{

CPUirqe();

}

void main()

{

GPIO3ModuleClkConfig();

GPIO3Pin6PinMuxSet();

GPIOModuleEnable(GPIO_3_INSTANCE_ADDRESS);

GPIOMduleReset(GPIO_3_INSTANCE_ADDRESS);

GPIODirModeSet(GPIO_3_INSTANCE_ADDRESS,6,GPIO_DIR_INPUT);

IntAINTCInit();

IntMasterIRQEnable();

IntRegister(SYS_INT_GPIOINT3A,ISR);

IntPrioritySet(SYS_INT_GPIOINT3A,1,AINTC_HOSTINT_ROUTE_IRQ);

IntSystemEnable(SYS_INT_GPIOINT3A);

while(1);

}

void ISR()

{

....

....

}

Please help me..

Thanks

  •  

    Hi Kamal,

    Sorry for the delayed response.

    Presently we do not have a board to test the GPIO3_6 Pin features.

    So i suggest can you verify your code and board setup for these details,

    1: Are you sure you are performing the correct PinMux for the particular
       GPIO instance?? The GPIO3_6 pin is muxed with I2C0_SCL line on the C16 pin
       for the EVMSK board.
       You can use GPIO_PMUX_OFFADDR_VALUE(instance, pin, padConfValue) macro
       defined in the "include/armv7a/am335x/pin_mux.h" which does the Pinmux
       for any GPIO instance.
       Refer the CardDetect example from StarterWare package.
      
    2: Can you enable the Debouncing feature for the input GPIO pin?
       If you are using a key press to generate a signal on the GPIO pin,
       then this can be one thing which can cause some problems.
      
    3: From the code shared you seems to have missed the step to set the
       type of signal (rising, falling edge or level) to trigger an interrupt.
       you have to make a call to GPIOIntTypeSet API.
       Also the step to enable the interrupt on the specified interrupt line
       is missing GPIOPinIntEnable must be called to enable the interrupts.
      
    4: You can also read the GPIO_DATAIN register to see if the change in the
       signal at the GPIO pin is captured. This can give an idea if input change
       at the pin is being sensed by the GPIO pin.
       
       

      
    Regards
    Anant Pai

  • Hi Anant,

    Thanks for the reply but i have done as you suggested, below are some reply for suggetions

    1: Are you sure you are performing the correct PinMux for the particular
       GPIO instance?? The GPIO3_6 pin is muxed with I2C0_SCL line on the C16 pin
       for the EVMSK board.
       You can use GPIO_PMUX_OFFADDR_VALUE(instance, pin, padConfValue) macro
       defined in the "include/armv7a/am335x/pin_mux.h" which does the Pinmux 
       for any GPIO instance.
       Refer the CardDetect example from StarterWare package.

    •     Yes, i am doing the  pinmuxing for gpio correctly. i have tested by driving it as output.

    2: Can you enable the Debouncing feature for the input GPIO pin?
       If you are using a key press to generate a signal on the GPIO pin,
       then this can be one thing which can cause some problems.

    • I don't know about debouncing , i will check that. But I am not using key press for interrupt, its coming from another controller but it behave like key press so i will check this.

             Can u help about this?? provide information which register i need to access for debouncing..

    3: From the code shared you seems to have missed the step to set the 
       type of signal (rising, falling edge or level) to trigger an interrupt.
       you have to make a call to GPIOIntTypeSet API.
       Also the step to enable the interrupt on the specified interrupt line
       is missing GPIOPinIntEnable must be called to enable the interrupts.

    • I have already set the  gpioInttype to rising edge as i need to interrupt on rising edge.  But nothing.

    4: You can also read the GPIO_DATAIN register to see if the change in the
       signal at the GPIO pin is captured. This can give an idea if input change
       at the pin is being sensed by the GPIO pin.

    • Yes i can read the GPIO_DATAIN egister for the pin and its value is changing from low to high. But nothing.

    Regards

  • Hi kamal,

    Please refer the section 25.3.4.4 of the TRM for information about Debouncing feature.

    The registers to configure are GPIO_DEBOUNCENABLE and GPIO_DEBOUNCINGTIME.

    Please refer the gpioCardDetect example for reference on how to enable this feature.

     Regards

    Anant Pai

     

     

  • Hi!

    I'm designing a new PCB with AM335x and I can't find information that I can use any GPIO as External Interupt.

    So my question is: can I use any pin of any GPIO as external interrupt?

    Regards

    Pawel

  • Pawel Pieniazek said:
    So my question is: can I use any pin of any GPIO as external interrupt?

    As far as I understood it: yes. At least there are enough registers to specify all GPI-pins to be used with an interrupt.

    But possibly this is a question for Sitara-forum since it depends on hardware and is not Starterware-specific.