• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C6000 Multicore DSP » C64x Multicore DSP Forum » GPIO interrupt on c6472 evm
Share
C6000 Multicore DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Training Available
TI provides self-paced online training that introduces the primary components of the KeyStone II family of SoC devices.

  • KeyStone II SoC Overview >
  • KeyStone II Software Overview >
  • KeyStone II ARM Cortex-A15 Corepac Overview >
  • More Information >
  • Check out
    Multicore Mix blog
    • $core_v2_blog.Current.Name

      OpenMP - All aboard!

      Posted 2 hours ago
      by Debbie Greenstreet
      With so many end products today relying on multicore DSPs for...
    • $core_v2_blog.Current.Name

      A look back: Two years of Multicore Mix

      Posted 1 day ago
      by Lauren Reed1
      A big thank you to everyone who participated in our contest last...
    • $core_v2_blog.Current.Name

      It’s our second anniversary, but you get the present!

      Posted 8 days ago
      by Lindsey Bare
      It’s hard to believe it’s already been two years...

    GPIO interrupt on c6472 evm

    GPIO interrupt on c6472 evm

    This question is not answered
    Zoltan Szakats
    Posted by Zoltan Szakats
    on Jul 09 2012 20:26 PM
    Prodigy20 points

    Hi!

    I'm trying to handle interrupts generated on rising edges of GPIO.

    Could you make some suggestions what I'm missing in the code below?

    The gpio_task is called, but then no interrupt is generated while toggling the GPIO0 and GPIO1 pins.

    CSL_GpioRegsOvly hGpio = (CSL_GpioRegsOvly)CSL_GPIO_0_REGS;

    #define GPIO_CFG_BASE (0x02B00000)
    #define GPIO_REG_BINTEN (0x8)
    #define GPIO_REG_DIR (0x10)
    #define GPIO_REG_OUT_DATA (0x14)
    #define GPIO_REG_SET_DATA (0x18)
    #define GPIO_REG_CLR_DATA (0x1C)
    #define GPIO_REG_IN_DATA (0x20)
    #define GPIO_REG_SET_RIS_TRIG (0x24)
    #define GPIO_REG_CLR_RIS_TRIG (0x28)
    #define GPIO_REG_SET_FAL_TRIG (0x2C)
    #define GPIO_REG_CLR_FAL_TRIG (0x30)

    void gpio_task(void)
    {

    LOG_printf(&trace,"gpio_task called");

    // Set GPIO 0 and 1 as outputs
    // Note: Normally you would want these as inputs, but in this case we
    // are configuring them as outputs to eliminate the need for external
    // loopbacks, etc.
    hGpio->DIR &= (~3); // set DIR0 and DIR1 to set them as outputs

    // Enable rising edge interrupt on GPIO 0 and 1
    hGpio->SET_RIS_TRIG = 0x3;

    // Enable BINTEN.EN0 (it gates all interrupts pertaining to bank0 pins)
    hGpio->BINTEN |= 1;

    while(1)
    {
    // Generate rising edge on GPIO 0 and 1
    hGpio->CLR_DATA = 3;
    hGpio->SET_DATA = 3;

    TSK_sleep(100);
    }
    }

    void gpio_0()
    {
    LOG_printf(&trace,"Executing gpio_0 ISR.");
    }


    void gpio_1()
    {
    LOG_printf(&trace,"Executing gpio_1 ISR.");
    }

    void main(void) {

    //set GPIO_0 pin as an input
    //*(unsigned int*)(GPIO_CFG_BASE+GPIO_REG_DIR) |= 0x1;
    //set GPIO_0 pin as an output
    *(unsigned int*)(GPIO_CFG_BASE+GPIO_REG_DIR) &= 0xFFFFFFFE;

    //set rising edge to trigger GPIO_0 interrupt
    *(unsigned int*)(GPIO_CFG_BASE+GPIO_REG_SET_RIS_TRIG) |= 0x1;

    //clear falling edge of GPIO_0
    *(unsigned int*)(GPIO_CFG_BASE+GPIO_REG_SET_FAL_TRIG) &= 0xFFFFFFFE;

    //enable GPIO interrupts
    *(unsigned int*)(GPIO_CFG_BASE+GPIO_REG_BINTEN) |= 0x1;

    //Start BIOS
    BIOS_start();

    /* fall into DSP/BIOS idle loop */
    return;

    }

    the TCF file looks like this:

    utils.loadPlatform("ti.platforms.evm6472");

    /* The following DSP/BIOS Features are enabled. */
    bios.enableRealTimeAnalysis(prog);
    bios.enableRtdx(prog);
    bios.enableTskManager(prog);

    bios.LOG.create("trace");
    bios.LOG.instance("trace").bufLen = 2048;
    bios.TSK.instance("TSK_idle").order = 1;

    bios.TSK.create("GPIO");
    bios.TSK.instance("GPIO").order = 3;
    bios.TSK.instance("GPIO").fxn = prog.extern("gpio_task");
    bios.TSK.instance("GPIO").priority = 3;

    bios.HWI.instance("HWI_INT4").interruptSelectNumber = 64;
    bios.HWI.instance("HWI_INT4").fxn = prog.extern("gpio_0");
    bios.HWI.instance("HWI_INT4").useDispatcher = 1;
    bios.HWI.instance("HWI_INT4").interruptMask = "all";

    bios.HWI.instance("HWI_INT5").interruptSelectNumber = 65;
    bios.HWI.instance("HWI_INT5").fxn = prog.extern("gpio_1");
    bios.HWI.instance("HWI_INT5").useDispatcher = 1;
    bios.HWI.instance("HWI_INT5").interruptMask = "all";

    // !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!

    prog.gen();

    Thanks in advance!

    Regards,

    ./z

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • RandyP
      Posted by RandyP
      on Jul 09 2012 22:28 PM
      Guru60130 points

      Zoltan,

      I strongly recommend you start with examples from the CSL library for the C6472 and/or from the MCSDK 1.x which also includes the CSL. I seem to recall there was an example for GPIOs that does an internal loopback and generates interrupts.

      Get one of those TI-supplied examples working, with interrupts, with GPIOs, and then try to move to your own specific application requirements.

      Regards,
      RandyP

      Search for answers, Ask a question, click  Verify  when complete, Help others, Learn more.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use