This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: EPI interface

Part Number: TM4C1294NCPDT

respected sir, dear friends,

I m configuring general purpose mode of EPI . I m referring the example in driver library user guide.I not able to get that which function should i use for write purpose??  Is it ok to use

void  EPIWorkaroundHWordWrite( )  function in general purpose mode??  

the configuration for EPI mode are as follows:-

EPIConfigGPModeSet(EPI0_BASE, (EPI_GPMODE_CLKPIN | EPI_GPMODE_ASIZE_4 | EPI_GPMODE_DSIZE_16), 2);

EPIAddressMapSet(EPI0_BASE, EPI_ADDR_PER_SIZE_256B | EPI_ADDR_PER_BASE_NONE);

  • Hi Digvijay,

     The EPIWorkaroundHWordWrite() and other similar API functions are intended to address EPI Errata #1. I don't think you need to use this API if you are in general purpose mode. The API provides errata workaround when running code from external area. 

    EPI#01 Data Reads can be Corrupted when the Code Address Space in the EPI Module is
    Used
    Revision(s) Affected: 1, 2, and 3.
    Description: The external code address space at address 0x1000.0000 is specified for the EPI
    module using the ECSZ and ECADR fields in the EPI Address Map (EPIADDRMAP).
    However, data reads can be corrupted when using this address space.
    Workaround(s): Code cannot be executed from the 0x1000.0000 address space. The EPI address
    spaces at 0x6000.0000 and 0x8000.0000 can be used instead.
    In addition, when reading from EPI memory mapped to the code address space at
    0x1000.0000, replace direct EPI memory reads via pointers with calls to the
    EPIWorkaroundWordRead(), EPIWorkaroundHWordRead() or
    EPIWorkaroundByteRead() functions depending on the data size for the read operation.
    Similarly, when writing to the EPI code address space, replace direct writes with calls to
    the EPIWorkaroundWordWrite(), EPIWorkaroundHWordWrite() or
    EPIWorkaroundByteWrite() functions. These APIs are new and can be found in
    Appendix 2. For Keil, IAR, GCC, and Code Bench, these functions are defined as inline
    functions in the epi.h file in C:\ti\TivaWare_C_Series-2.0\driverlib. For CCS, which
    doesn’t support this structure, these should be added to a new file placed in the \driverlib
    directory called epi_workaround_ccs.s, and this file should be added to the project. Note
    that the new DriverLib APIs and the CCS file mentioned in Appendix 2 are included in
    TivaWare release 2.0.1 and later releases.

  • thanks for reply sir. I get that i dont have to use EPIWorkaroundHWordWrite()  function . Then which function should i use for write?? i m not able to find it in driver library user guide.

  • You will use EPIAddressMapSet to configure the base address of of your external peripheral. Afterward you can just read/write to the external peripheral directly like you are writing to the internal memories/peripherals. Check the epi example and below code snippet. Even though it is for sdram interface but the idea is the same.

    //
        // Set the EPI memory pointer to the base of EPI memory space.  Note that
        // g_pui16EPISdram is declared as volatile so the compiler should not
        // optimize reads out of the memory.  With this pointer, the memory space
        // is accessed like a simple array.
        //
        g_pui16EPISdram = (uint16_t *)0x60000000;
    
        //
        // Read the initial data in SDRAM, and display it on the console.
        //
        UARTprintf("  SDRAM Initial Data:\n");
        UARTprintf("     Mem[0x6000.0000] = 0x%4x\n",
                   g_pui16EPISdram[SDRAM_START_ADDRESS]);
        UARTprintf("     Mem[0x6000.0001] = 0x%4x\n",
                   g_pui16EPISdram[SDRAM_START_ADDRESS + 1]);
        UARTprintf("     Mem[0x603F.FFFE] = 0x%4x\n",
                   g_pui16EPISdram[SDRAM_END_ADDRESS - 1]);
        UARTprintf("     Mem[0x603F.FFFF] = 0x%4x\n\n",
                   g_pui16EPISdram[SDRAM_END_ADDRESS]);
    
        //
        // Display what writes we are doing on the console.
        //
        UARTprintf("  SDRAM Write:\n");
        UARTprintf("     Mem[0x6000.0000] <- 0xabcd\n");
        UARTprintf("     Mem[0x6000.0001] <- 0x1234\n");
        UARTprintf("     Mem[0x603F.FFFE] <- 0xdcba\n");
        UARTprintf("     Mem[0x603F.FFFF] <- 0x4321\n\n");
    
        //
        // Write to the first 2 and last 2 address of the SDRAM card.  Since the
        // SDRAM card is word addressable, we will write words.
        //
        g_pui16EPISdram[SDRAM_START_ADDRESS] = 0xabcd;
        g_pui16EPISdram[SDRAM_START_ADDRESS + 1] = 0x1234;
        g_pui16EPISdram[SDRAM_END_ADDRESS - 1] = 0xdcba;
        g_pui16EPISdram[SDRAM_END_ADDRESS] = 0x4321;
    
        //
        // Read back the data you wrote, and display it on the console.
        //
        UARTprintf("  SDRAM Read:\n");
        UARTprintf("     Mem[0x6000.0000] = 0x%4x\n",
                   g_pui16EPISdram[SDRAM_START_ADDRESS]);
        UARTprintf("     Mem[0x6000.0001] = 0x%4x\n",
                   g_pui16EPISdram[SDRAM_START_ADDRESS + 1]);
        UARTprintf("     Mem[0x603F.FFFE] = 0x%4x\n",
                   g_pui16EPISdram[SDRAM_END_ADDRESS - 1]);
        UARTprintf("     Mem[0x603F.FFFF] = 0x%4x\n\n",
                   g_pui16EPISdram[SDRAM_END_ADDRESS]);
    
        //
        // Check the validity of the data.
        //
        if((g_pui16EPISdram[SDRAM_START_ADDRESS] == 0xabcd) &&
           (g_pui16EPISdram[SDRAM_START_ADDRESS + 1] == 0x1234) &&
           (g_pui16EPISdram[SDRAM_END_ADDRESS - 1] == 0xdcba) &&
           (g_pui16EPISdram[SDRAM_END_ADDRESS] == 0x4321))