Texas Instruments
  • Samples Cart - Add Samples Samples & Purchase Cart
  • |
  • Contact Us
  • |
  • TI Worldwide: United States
  • |
  • my.TI Login
  • Products
  • Applications
  • Design Support
  • Sample & Buy

  • All Searches
TI Home » TI E2E Community » Support Forums » Microcontrollers » Stellaris® ARM® Cortex™-M Microcontroller » Stellaris® General Discussions » LM3S6965 slow GPIO output
  • Join
  • Sign In with my.TI Login

TI E2E™ Community

  • Home
  • Support Forums
  • Videos
  • Blogs
  • Groups
  • More ...
  • Go
  • Advanced Search
Share
Details
Rate This
  • 3 Replies
  • 2 Subscribers
  • 277 Views
  • Posted3 months ago
Options
  • Subscribe via RSS
Helpful Stellaris® LM4F Series Links
  • LM4F Series
  • LM4F MCU Applications
  • LM4F MCU Video
  • ARM Cortex-M4F Whitepaper
  • Stellaris MCU Brochure
  • LM4F232 Eval Kit
  • Tags
    • #if
    • #if defined
    • #ifdef
    • #pragma
    • %f
    • "coachability"
    • "LM Flash Programmer"
    • "LM FLASH Programmer" "command line"
    • "LM Flash Programmer" LM3S8962 USB510L
    • "LMI FTDI Driver Error"
    • "unsuccessful data search..."
    • "USB Hub" USB
    • .bin
    • .cmd
    • .map
    • .NET
    • .NET Framework
    • .NET Gadgeteer
    • .NET Micro Framework
    • .out
    • _IQfrac
    • _IQmpy
    • `
    • 0x11e
    • 1154


    Get Adobe Flash player
    Forum - Title

    Forums

    Stellaris® ARM® Cortex™-M Microcontroller

    Stellaris® ARM® Cortex™-M Microcontroller

    Welcome to the Stellaris® ARM® Cortex™-M Microcontroller Section of the TI E2E Support Community. Ask questions, share knowledge, explore ideas, and help solve problems with fellow engineers. To post a question, click on the forum tab then "New Post".

    • Get this RSS feed
    • Home
    • Forums

    LM3S6965 slow GPIO output

    This question is answered
    Hans Gerritsen
    Posted by Hans Gerritsen
    on Feb 7, 2012 11:01 AM
    Prodigy20 points

    Hi,
    I am using the EKI-LM3S6965 dev kit (rev D22) and have troubles with generating
    (fast) output pulses on the GPIO output. The software I am using is the IAR workbench
    (and the LM Flash programmer).

    The below test code works ok but the output pulses have a frequency of only 2.5 MHz
    which seems to be very slow. Tried to use the faster AHB bus (commented code) but this
    did not run at all.

    Some help would be appreciated,

    Hans Gerritsen




    //  
    //   clock @ 50 MHz
    SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
                           SYSCTL_XTAL_8MHZ);
    //



    //   
     //  GPIO_PORT_D   Pin 2 output
    //
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);         // switch on D
        GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_2);  // normal bus
        
    //    SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOD);          // switch on D AHB
    //    GPIOPinTypeGPIOOutput(GPIO_PORTD_AHB_BASE, GPIO_PIN_2);

        
        for (i=0; i<100000000; i++) {
                GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_2,GPIO_PIN_2);
                GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_2,0x00);  

    //          GPIOPinWrite(GPIO_PORTD_AHB_BASE,GPIO_PIN_2,GPIO_PIN_2); // AHB bus
    //          GPIOPinWrite(GPIO_PORTD_AHB_BASE,GPIO_PIN_2,0x00);       // AHB bus
             }
        

    GPIO LM3S6965 Ethernet Evaluation Board
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Sue Cozart
      Posted by Sue Cozart
      on Feb 7, 2012 12:34 PM
      Mastermind40715 points

      Hi Hans,

      There are several forum threads on this topic.  See:

      • http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/t/45880.aspx#155668
      • http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/t/44495.aspx#154281
      That should help you get going in the right direction.  Let me know if you have further questions after reading these threads.
      Regards,
      Sue
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hans Gerritsen
      Posted by Hans Gerritsen
      on Feb 11, 2012 10:35 AM
      Prodigy20 points

      Thanks for your suggestions Sue,

      Using:

           HWREG(GPIO_PORTD_BASE + GPIO_O_DATA + (GPIO_PIN_2 << 2)) = GPIO_PIN_2;
           HWREG(GPIO_PORTD_BASE + GPIO_O_DATA + (GPIO_PIN_2 << 2)) = 0; 

      + compiler optimization resulted in ~70ns output pulses on my (slow) scope.

      I still wander what the AHB bus can do to speed up the code. There is very little reference to the AHB bus in the manuals.

      Regards,

      Hans



      LM3S6965 GPIO
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Sue Cozart
      Posted by Sue Cozart
      on Feb 13, 2012 2:59 PM
      Verified Answer
      Verified by Sue Cozart
      Mastermind40715 points

      Hi Hans,

      I'm glad you made progress.  The AHB runs at the same speed as the APB, it just can perform back-to-back accesses more efficiently.

      To use the AHB, you have to first assign the port to the AHB using the SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOD) function.  After you have done that, you can use the instructions above and substitute GPIO_PORTD_AHB_BASE.

      Regards,

      Sue

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    Share

    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.

    Products | Applications | Design Support | Sample & Buy RSS

    TI Worldwide | About TI | Contact Us | Investor Relations | Press Center | Corporate Citizenship | Careers | Tags | my.TI Login | All Searches | Site Map

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