• 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 » Stellaris® ARM® Microcontrollers » Stellaris® ARM® LM3S Microcontrollers Forum » LM3S9B96 EPI SRAM
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS
Helpful Stellaris® LM4F Series Links
  • LM4F Series
  • Stellaris PinMux Utility
  • Stellaris® LM4F120 LaunchPad
  • LM4F MCU Applications
  • LM4F MCU Video
  • ARM Cortex-M4F Whitepaper
  • Stellaris MCU Brochure
  • LM4F232 Eval Kit
  • Forums

    LM3S9B96 EPI SRAM

    This question is not answered
    Justin Forrester
    Posted by Justin Forrester
    on Mar 30 2012 16:18 PM
    Expert1015 points

    Hi,

    I have just started attempting to implement EPI SRAM on our LM3S9B96 modules and I have encountered a small problem.  When reading data back, the MSB of every byte is 0.  So, if I write 0xFFFF, I read back 0x7F7F.  I have tested line continuity from the Stellaris process, to the D Latch and from there to the SRAM chip.  I am using the same parts as the DK-LM3S9B96-FS8.  Below is the code I am using to initialize the EPI port, read, and write values.  Any advise on what might be going on would be appreciated.

    #define EPI_PORTB_PINS (GPIO_PIN_4 | GPIO_PIN_5)
    #define EPI_PORTC_PINS (GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7)
    #define EPI_PORTD_PINS (GPIO_PIN_2 | GPIO_PIN_3)
    #define EPI_PORTE_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3)
    #define EPI_PORTF_PINS (GPIO_PIN_4 | GPIO_PIN_5)
    #define EPI_PORTG_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_7)
    #define EPI_PORTH_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7)
    #define EPI_PORTJ_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6)

    static volatile unsigned long *sram;

    void initMemory() {
        SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0);
        
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
        
        GPIOPinConfigure(GPIO_PH3_EPI0S0);
        GPIOPinConfigure(GPIO_PH2_EPI0S1);
        GPIOPinConfigure(GPIO_PC4_EPI0S2);
        GPIOPinConfigure(GPIO_PC5_EPI0S3);
        GPIOPinConfigure(GPIO_PC6_EPI0S4);
        GPIOPinConfigure(GPIO_PC7_EPI0S5);
        GPIOPinConfigure(GPIO_PH0_EPI0S6);
        GPIOPinConfigure(GPIO_PH1_EPI0S7);
        GPIOPinConfigure(GPIO_PE0_EPI0S8);
        GPIOPinConfigure(GPIO_PE1_EPI0S9);
        GPIOPinConfigure(GPIO_PH4_EPI0S10);
        GPIOPinConfigure(GPIO_PH5_EPI0S11);
        GPIOPinConfigure(GPIO_PF4_EPI0S12);
        GPIOPinConfigure(GPIO_PG0_EPI0S13);
        GPIOPinConfigure(GPIO_PG1_EPI0S14);
        GPIOPinConfigure(GPIO_PF5_EPI0S15);
        GPIOPinConfigure(GPIO_PJ0_EPI0S16);
        GPIOPinConfigure(GPIO_PJ1_EPI0S17);
        GPIOPinConfigure(GPIO_PJ2_EPI0S18);
        GPIOPinConfigure(GPIO_PJ3_EPI0S19);
        GPIOPinConfigure(GPIO_PD2_EPI0S20);
        GPIOPinConfigure(GPIO_PD3_EPI0S21);
        GPIOPinConfigure(GPIO_PB5_EPI0S22);
        GPIOPinConfigure(GPIO_PB4_EPI0S23);
        GPIOPinConfigure(GPIO_PE2_EPI0S24);
        GPIOPinConfigure(GPIO_PE3_EPI0S25);
        GPIOPinConfigure(GPIO_PH6_EPI0S26);
        GPIOPinConfigure(GPIO_PH7_EPI0S27);
        GPIOPinConfigure(GPIO_PJ4_EPI0S28);
        GPIOPinConfigure(GPIO_PJ5_EPI0S29);
        GPIOPinConfigure(GPIO_PJ6_EPI0S30);
        GPIOPinConfigure(GPIO_PG7_EPI0S31);
        
        GPIOPinTypeEPI(GPIO_PORTB_BASE, EPI_PORTB_PINS);
        GPIOPinTypeEPI(GPIO_PORTC_BASE, EPI_PORTC_PINS);
        GPIOPinTypeEPI(GPIO_PORTD_BASE, EPI_PORTD_PINS);
        GPIOPinTypeEPI(GPIO_PORTE_BASE, EPI_PORTE_PINS);
        GPIOPinTypeEPI(GPIO_PORTF_BASE, EPI_PORTF_PINS);
        GPIOPinTypeEPI(GPIO_PORTG_BASE, EPI_PORTG_PINS);
        GPIOPinTypeEPI(GPIO_PORTH_BASE, EPI_PORTH_PINS);
        GPIOPinTypeEPI(GPIO_PORTJ_BASE, EPI_PORTJ_PINS);
        
        EPIDividerSet(EPI0_BASE, 0);
        
        EPIModeSet(EPI0_BASE, EPI_MODE_HB8);
        
        EPIConfigHB8Set(EPI0_BASE, (EPI_HB8_MODE_ADMUX | EPI_HB8_WRWAIT_1 | EPI_HB8_RDWAIT_1 | EPI_HB8_WORD_ACCESS), 0);
        EPIAddressMapSet(EPI0_BASE, (EPI_ADDR_RAM_SIZE_256MB | EPI_ADDR_RAM_BASE_6) );
                          
        //EPIAddressMapSet(EPI0_BASE, EPI_ADDR_RAM_SIZE_16MB | EPI_ADDR_RAM_BASE_6);
        
        while(HWREG(EPI0_BASE + EPI_O_STAT) &  EPI_STAT_INITSEQ)
        {
        }
        
        sram = (unsigned long *)0x68000000;
    }

    int main(void) {

        unsigned long memoryReadData = 0;

        SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); // External 16MHz

        initMemory();
        
        sram[0] = 0xFFFF;    
        memoryReadData = sram[0];

    }

    LM3S9B96 EPI
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Justin Forrester
      Posted by Justin Forrester
      on Apr 16 2012 11:47 AM
      Expert1015 points

      Okay, so it turns out the issue was hardware related and that problem has been resolved.

      Now I am attempting to read from flash RAM using the same code (with added fram = (unsigned char *)0x60000000 line, a loop to write incremental values, and another loop to read them back).  However, all reads return 0xFF .  Any suggestions on what may resolve this issue?  Is there anything wrong with the code?  Again, same parts and duplicated circuit from DK-LM3S9B96-FS8.

      Thanks!

      Justin

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Stellaris Dexter
      Posted by Stellaris Dexter
      on Apr 24 2012 07:17 AM
      Genius13505 points

      Justin,

      You have referred to the memory device with several different terms.  You have called it "flash RAM", "SRAM" and "fram".  You have also told us that it is the same parts and circuit as the DK-LM3S9B96-FS8.  The FS8 contains both a flash and an SRAM.  

      If you have properly duplicated the DK-LM3S9B96-FS8 then you should be able to run our example code to verify your circuit.  The example code is known to work, don't modify it unless you absolutely have to in order for it to work on your system.

      Does your circuit contain both the flash and the SRAM?  If so which are you trying to communicate with?  I suggest you get the SRAM working first if you have both.

      0xFF is the default blank state of most flash memories.  Flash often cannot be simply written to like a SRAM it may require special timing and register writes to the device.  It also takes a long time to write to and erase flash.  If you are immediately reading back what you have written even if the write was done correctly the device may not have completed physically writing the data.

      Dexter


      http://www.ti.com/tool/ek-lm4f120xl
      http://www.ti.com/stellarislaunchpadworkshop
      http://processors.wiki.ti.com/index.php/Stellaris_LaunchPad
      http://www.ti.com/tool/sw-ek-lm4f120xl
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Justin Forrester
      Posted by Justin Forrester
      on Apr 25 2012 13:11 PM
      Expert1015 points

      Dexter,

      I believe I have solved all my issues with the memory.  I am using both SRAM and Flash.  You are correct that the flash cannot be written to as I would the SRAM, you need to send several bytes to set it to write mode.  However, I was unable to find where the read/write operations are used in example code for the kit.  Do you know of a specific example?

      Thanks!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Stellaris Dexter
      Posted by Stellaris Dexter
      on Apr 25 2012 14:21 PM
      Genius13505 points
      C:\StellarisWare\boards\dk-lm3s9b96\drivers\extflash.c should contain our API's to read, write, erase and other functions for this flash.

      http://www.ti.com/tool/ek-lm4f120xl
      http://www.ti.com/stellarislaunchpadworkshop
      http://processors.wiki.ti.com/index.php/Stellaris_LaunchPad
      http://www.ti.com/tool/sw-ek-lm4f120xl
      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