• 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) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » writing and reading SRAM using |TMS320C5505
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Forums

    writing and reading SRAM using |TMS320C5505

    This question is answered
    Barry Turner
    Posted by Barry Turner
    on Nov 16 2010 15:23 PM
    Intellectual610 points

    I am trying to test my interface to my off chip SRAM. I have initialize the EMIF registers in a GEL file. I can read and write to the memory using the view option. When I run my application to write know values to the memory it does not write to the memory correctly. Sometimes I have to shut down my CCS and restart the emualtor and my target. I have 1 meg words of SRAM. This is the code I wrote to store the values in memory.

     Uns *myptr;
     int i;

     myptr = (Uns *)0x600000;

     for (i = 0; i < 1000; i++)
     {
      *myptr = (Uns)0x1234;
      myptr++;
      *myptr = (Uns)0xbeef;
      myptr++;
    } 

    Is this a correct way to write to the memory?

    Thanks

    Barry

     

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Pratap Reddy M V
      Posted by Pratap Reddy M V
      on Nov 17 2010 08:35 AM
      Verified Answer
      Verified by Barry Turner
      Expert1295 points

      Hi Barry,

      What is the data type 'Uns'.

      Just for sanity check try the instruction *(unsigned int*)0x600000 = 0x1234;

      Pratap.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Barry Turner
      Posted by Barry Turner
      on Nov 17 2010 10:55 AM
      Intellectual610 points

      Pratap

      Uns is defined in the TMS320 DSP/BIOS User's Guide on page 1-12 as unsigned integer value. I can currently single step my program and it will write to memory correctly. It appears to write in mutiple addresses it should not be writing to if I let it run.I initialize the EMIF registers in a gel FILE as follows:

          *(short *)SRAM_Async_Wait_Reg_1@IO = 0x0080;
          *(short *)SRAM_Async_Wait_Reg_2@IO = 0x4030;
          *(short *)SRAM_Async_CS3_Reg_1@IO = 0x4521;
          *(short *)SRAM_Async_CS3_Reg_2@IO = 0x0031;
       
       *(short *)ESCRREG = 0x0000;

      I may still have JTAG interface problems on my target.

      Barry

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Pratap Reddy M V
      Posted by Pratap Reddy M V
      on Nov 17 2010 11:43 AM
      Verified Answer
      Verified by Barry Turner
      Expert1295 points

      Hi Barry,

      Seems like there are some timing issues in your EMIF configurations for SRAM.

      Do you have CSL2.10?. If yes check for the function SRAM_INIT() in the file c55xx_csl\build\c5505evm_pg20.gel file. See if the same timing configurations work for you. This gel file is for C5515 so don't use the complete gel file, just take the SRAM configurations. EMIF chip select configurations for SRAM are set for CS4, you need to change it to CS2.

      Pratap.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Barry Turner
      Posted by Barry Turner
      on Nov 17 2010 13:05 PM
      Intellectual610 points

      Pratap

      I tried the SRAM configuration out of c55xx_csl\build\c5505evm_pg20.gel file but got the same results. I guess I will keep changing the configuration to see if I can fnd one that works.

      Thanks

      Barry

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • DSP_KungFu_Master
      Posted by DSP_KungFu_Master
      on Feb 11 2011 06:53 AM
      Intellectual700 points

      Hello,

       

      @Barry Turner - Have you solved your problem? What was the correct solution? Can you please send me settings that worked for you?

       

      @Pratap - You mentioned that: "c5505evm_pg20.gel file.  This gel file is for C5515 so don't use the complete gel file, just take the SRAM configurations. EMIF chip select configurations for SRAM are set for CS4, you need to change it to CS2."

       

      But if you look at the beginning of the file there are two defines:

      #define SRAM_ASYNC4CTRL0 0x101C

      #define SRAM_ASYNC4CTRL1 0x101D

       

      According to C5515 datasheet 0x101C and 0x101D are adresses for Asynchronous CS5 Configuration Register and not Async4.? Is the GEL file wrong or is it something else?

       

      I'm experiencing same problem as Barry. I have SRAM connected to CS4, but when I try to write into it I see in the memory window that the same byte is written into several different locations.

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Barry Turner
      Posted by Barry Turner
      on Feb 14 2011 11:24 AM
      Intellectual610 points

      Pratap

      I did get it to work. The following is the code that is used to initialize the SRAM.

       

       

       

      void

       

       

       

      InitaliseSramHw(void

      )

      {

      * EMIF_SYSTEM_CONTROL_REGISTER = 0x0000;   //location 0x1c33

       

       

       

      /* SRAM */

      * EMIF_ASYNC_CONFIG_REG_1_CS_3 = 0x2101;   // location 0x1014

      * EMIF_ASYNC_CONFIG_REG_2_CS_3 = 0x0020;   // location 0x1015

       

       

       

       

      /* Clocked Emif */

      * EMIF_ASYNC_CONFIG_REG_1_CS_5 = 0x078D;   // location 0x101c

      // * EMIF_ASYNC_CONFIG_REG_2_CS_5 = 0x80A0; 60 mhz

      * EMIF_ASYNC_CONFIG_REG_2_CS_5 = 0x83f0;    // location 0x101d

      }

       

      Regards

      Barry

       

      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