how to ucos-III zynq gpio interrupt

how to ucos-III zynq gpio interrupt

Home Forums Example Projects how to ucos-III zynq gpio interrupt

This topic contains 5 replies, has 4 voices, and was last updated by  amintanharpd@yahoo.com 1 year, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #24271

    mike tran
    Participant

    Hi UCOS,

    Microzed (xc7z020clg400-1), Micrium_Xilinx_Repo_1_43.zip, xilinx vivado/sdk 2016.2

    I am testing gpio interrupt of UCOS-III on Microzed.

    Borrowed xilinx vivado/sdk program (helloworld Adam Taylor Part 13.docx ‏16 KB) from https://forums.xilinx.com/t5/Xcell-Daily-Blog/More-About-MicroZed-Interrupts-Adam-Taylor-s-MicroZed-Chronicles/ba-p/398357

    However, I have trouble to migrate to UCOS-III, particularly I donot know how to define gpio interrupt in UCOS-III. Reference to AXI Timer 1 from https://doc.micrium.com/display/UCOSXSDK/uCOS+BSP+on+the+Zynq-7000+Tutorial

    I started as follow, but the program kept interrupted even without button-push.

    //Enable interrupts for all the pins in bank 0.
    XGpioPs_SetIntrTypePin(&Gpio, pbsw, XGPIOPS_IRQ_TYPE_EDGE_RISING);

    //Enable the GPIO interrupts of Bank 0.
    XGpioPs_IntrEnablePin(&Gpio, pbsw);

    UCOS_IntVectSet(GPIO_INTERRUPT_ID, 0, DEF_BIT_00, myIntrHandler, &Gpio);
    UCOS_IntSrcEn(GPIO_INTERRUPT_ID);

    If I commented out XGpioPs_IntrEnablePin(&Gpio, pbsw); then the program never enter interrupt ISR.

    Please advise, thanks in advance.

    Mike

    #24309

    mike tran
    Participant

    solved problem by myself. why no one touch this post?

    #24341

    Farukh Chaudhry
    Participant

    Mike,

    I read your post, but was unable to provide a good reason for your problem. What was the solution?

    #24346

    mike tran
    Participant

    Hi Farukh Chaudhry,

    Thank you for your attention.

    The program cannot jump out of ISR routine, which means interrupt Handler needs to clear the interrupt by itself. Therefore, I added XGpioPs_IntrClearPin(&Gpio, pbsw) and solved the problem.

    void myIntrHandler (void *p_arg, CPU_INT32U cpu)
    {
    XGpioPs_IntrClearPin(&Gpio, pbsw);

    OS_ERR os_err;
    printf(“enter interrupt \n\r”);

    OSSemPost(&GPIO1Semaphore, 0, &os_err);
    }

    Best

    Mike

    #25300

    Monica Yadav
    Participant

    Hi Mike,

    I am also trying to implement Gpio Interrupt controller using microblaze on ucosii. But I am stuck as the proper documentation of ucos interrupt control driver is not available. Could you please attach your code for the reference.
    I would be very thankful

    #25402

    hi mike , i don’t work with your processor but i had same problem and i solved but i have a new problem .
    please see this topic thanks 😉

    help about interrupt uc/os 2.91 lpc1768


    anyway , my problem is i can’t use again of interrupt means i can use 1 time then interrupt don’t active again , if i active again OS go to halt ,can you help me?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

View the complete site map

x
Loading...