• 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 » Microcontrollers » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » F2812 flash registers
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • InstaSPIN Simulation Tool
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • Forums

    F2812 flash registers

    This question is answered
    Gary Lynch
    Posted by Gary Lynch
    on Apr 30 2012 14:21 PM
    Expert1170 points

    I am attempting to port an application from RAM to flash for
    a TMS320F2812, using CCSv4 and want to understand the
    programming of the flash registers better than on my last
    pass. Document SPRA958K provides a function to initialize
    these registers on page 13:
    >
    > /********************************************************************
    > * NOTE: The InitFlash() function shown here is just an example of an
    > * initialization for the flash control registers. Consult the device
    > * datasheet for production wait state values and any other relevant
    > * information. Wait-states shown here are specific to current F280x
    > * devices operating at 100 MHz.
    > * NOTE: This function assumes use of the Peripheral Header File
    > * structures (see References [23-29]).
    > ********************************************************************/
    >
    > #pragma CODE_SECTION(InitFlash, "secureRamFuncs")
    > void InitFlash(void)
    > {
    >   asm(" EALLOW");                             // Enable EALLOW protected register access
    >   FlashRegs.FPWR.bit.PWR = 3;                 // Flash set to active mode
    >   FlashRegs.FSTATUS.bit.V3STAT = 1;           // Clear the 3VSTAT bit
    >   FlashRegs.FSTDBYWAIT.bit.STDBYWAIT = 0x01FF; // Sleep to standby cycles
    >   FlashRegs.FACTIVEWAIT.bit.ACTIVEWAIT = 0x01FF; // Standby to active cycles
    >   FlashRegs.FBANKWAIT.bit.RANDWAIT = 3;       // F280x Random access wait states
    >   FlashRegs.FBANKWAIT.bit.PAGEWAIT = 3;       // F280x Paged access wait states
    >   FlashRegs.FOTPWAIT.bit.OTPWAIT = 5;         // F280x OTP wait states
    >   FlashRegs.FOPT.bit.ENPIPE = 1;              // Enable the flash pipeline
    >   asm(" EDIS");                               // Disable EALLOW protected register access
    >
    >   /*** Force a complete pipeline flush to ensure that the write to the last register
    >   configured occurs before returning. Safest thing is to wait 8 full cycles. ***/
    >
    >   asm(" RPT #6 || NOP"); // Takes 8 cycles to execute
    > } //end of InitFlash()
    >
    Note that the comment which precedes the function completely
    disclaims its functionality on the F2812. 

    The register block "FlashRegs" is defined in header
    DSP281x_SysCtrl.h, but it tells me nothing about what those
    bits do. I can find no mention of these registers in any
    reference guide or other support document available on the
    TI web site.

    Assuming I find a performance problem with my flash and want
    to optimize the wait states for the F2812, where to I get
    the info necessary to do so?

    ============================================================
    Gary Lynch    printf("lynchg%cstacoenergy%ccom", 55+9, 55-9)
    ============================================================

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Vaishnavi Ramachandran
      Posted by Vaishnavi Ramachandran
      on Apr 30 2012 15:06 PM
      Verified Answer
      Verified by Gary Lynch
      Intellectual1930 points

      Gary,

      The disclaimer is to let the user know that the wait-states in the example is assumed for 100MHz system frequency. The comment basically asks the user to modify the wait-state as per device frequency.

      You can refer to section 1.3 of the F281x System control guide for the Flash and OTP registers which has the register description. Here's the link : http://www.ti.com/lit/ug/spru078f/spru078f.pdf

      Regarding the waitstate setting as per system frequency , please refer to Section 6.31, Flash timing section of the data sheet. http://www.ti.com/lit/ds/symlink/sm320f2812.pdf

      -Vaish

       


      If a post answers your question, please mark it with the "Verify Answer" button

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Gary Lynch
      Posted by Gary Lynch
      on May 01 2012 07:45 AM
      Verified Answer
      Verified by Lori Heustess
      Expert1170 points

      Would you believe I actually scanned both those documents
      and missed the sections you cited?

      I am running at 150 MHz, rather than 100. The data sheet
      actually has a table on page 157 with a plethora of wait
      state values for many clock frequencies, leading me to
      conclude I only need to change 3 statements from the code I
      posted:
      >
      >   FlashRegs.FBANKWAIT.bit.RANDWAIT     = 5;
      >   FlashRegs.FBANKWAIT.bit.PAGEWAIT     = 5;
      >   FlashRegs.FOTPWAIT.bit.OTPWAIT       = 8;
      >
      to conform to my project settings.

      Thanks for the pointers.

      ============================================================
      Gary Lynch    printf("lynchg%cstacoenergy%ccom", 55+9, 55-9)
      ============================================================

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Vaishnavi Ramachandran
      Posted by Vaishnavi Ramachandran
      on May 21 2012 10:12 AM
      Intellectual1930 points

      Sure. It tends to happen.

      Glad you were able to resolve this issue.

      -Vaish

       


      If a post answers your question, please mark it with the "Verify Answer" button

       

      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