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.

TMS320F28379D: Using EMIF on TMS320F28379D

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hi,

I need to use EMIF with an asynchronous memory (8 bits data). I've one question concerning mapping ; in the datasheet, we can read :

"Of special note is the connection between the EMIF and the external device's address bus. The EMIF address pin EM1A[0] always provides the least significant bit of a 32-bit word address. Therefore, when interfacing to a 16-bit or 8-bit asynchronous device, the EM1BA[1] and EM1BA[0] pins provide the least significant bits of the halfword or byte address, respectively. Figure 25-9 and Figure 25-10 show the mapping between the EMIF and the connected device's data and address pins for various programmed data bus widths. The data bus width may be configured in the asynchronous n configuration register (ASYNC_CSn_CR)."

But when I'm looking in examples in C2000 C:\ti\c2000\C2000Ware_1_00_06_00\device_support\f2837xd\examples\..., I don't think we use these pins.

So my question is : my asynchronous memory (16k) need 14 address pins connection :
- I have to connect A0 to A13 on my DSP port?
- Or I have to connect EM1BA[0-1] and A0 to A11?

It is not very clear for me.

Thank you.

  • Hi,

    electrocc said:
    So my question is : my asynchronous memory (16k) need 14 address pins connection :

    What is the word size for the async memory you are using? The connections would depend on that. In case of memory with 16-bit word size, address line 0 would be connected to EM!BA[1] and rest of the required  address lines would be connected to EM1A[x:0].

    Thanks

    Vasudha

  • Hi Vasudha,

    You mean my data word size? I'm using a 8-bit word size.

    Thanks

  • One other question because I didn't understand EMIF documentation very well.

    This is the memory map of the external memory I want to use :

    Is it possible to use /EM1CS[3] to communicate with this device? 

    Regards

  • Hi,

    Yes, you should be able to use CS3 (and any other ASYNC chip select) for this memory map. Please note memory map of external device is just off set address.

    Also on below query -

    So my question is : my asynchronous memory (16k) need 14 address pins connection :
    - I have to connect A0 to A13 on my DSP port?
    - Or I have to connect EM1BA[0-1] and A0 to A11?

    For 8bit memory interface you have to connect EM1BA[0-1] and A0 to A11.

    Regards,

    Vivek Singh

  • Hi Vivek,

    Thank you for your answer. 

    Vivek Singh said:

    Please note memory map of external device is just off set address.

    That's the point I don't understand. EMIF1 start at address 0x100000, how can I write in "Zone Message Write" area in my memory, starting address 0x3B00 to address 0x3C06?

    Thank you

  • Hi,

    You add the offset address to base address of EMIF. So if you want to write at address 0x3B00, you write at 0x103B00 but please note that C28x access are 16 bit so it'll write 16bit at a time which means write to 0x103B00 will translate into two 8bit access (since you are using 8bit memory) to address 0x3B00 and 0x3B01.

    Hope this makes it clear.

    Regards,

    Vivek Singh

  • Hi Vivek,

    Thank you for your answer, I'll try.

    First, I want to test a simple programm.
    I've found a thread e2e.ti.com/.../774580, I've corrected the software with the tlee corrections , and I've run it.
    Datas pins are toggling (oscilloscope checking), so it's ok. But when I'm looking at memory address 0x10 0000, all I see is 0x0000

    //
    // Included Files
    //
    #include "F28x_Project.h"
    
    #define ASRAM_CS2_START_ADDR 0x100000
    
    extern void setup_emif1_pinmux_async_16bit(Uint16);
    extern void Emif1Initialize(void);
    
    void main(void)
    {
    
        long *DUTY;
    
        // Initialize system control
        InitSysCtrl();
        DINT;
    
        //  Initialize the PIE control registers to their default state.
        //  The default state is all PIE interrupts disabled and flags
        //  are cleared.
        //  This function is found in the F2837xS_PieCtrl.c file.
        //
        InitPieCtrl();
    
        // Disable CPU interrupts and clear all CPU interrupt flags:
        EALLOW;
        IER = 0x0000;
        IFR = 0x0000;
        EDIS;
    
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // GService Routines (ISR).
        // This will populate the entire table, even if the interrupt
        // is not used in this example.  This is useful for debug purposes.
        // The shell ISR routines are found in F2837xS_DefaultIsr.c.
        // This function is found in F2837xS_PieVect.c.
        InitPieVectTable();
    
        //Configure to run EMIF1 on full Rate (EMIF1CLK = CPU1SYSCLK)
        EALLOW;
        ClkCfgRegs.PERCLKDIVSEL.bit.EMIF1CLKDIV = 0x0;
        EDIS;
    
        EALLOW;
        // Grab EMIF1 For CPU1
        Emif1ConfigRegs.EMIF1MSEL.all = 0x93A5CE71;
    
        //Disable Access Protection (CPU_FETCH/CPU_WR/DMA_WR)
        Emif1ConfigRegs.EMIF1ACCPROT0.all = 0x0;
    
    
        // Commit the configuration related to protection. Till this bit remains set
        // content of EMIF1ACCPROT0 register can't be changed.
        Emif1ConfigRegs.EMIF1COMMIT.all = 0x1;
    
    
        // Lock the configuration so that EMIF1COMMIT register can't be
        // changed any more.
        Emif1ConfigRegs.EMIF1LOCK.all = 0x1;
    
        EDIS;
    
    
        Emif1Initialize();
    
        setup_emif1_pinmux_async_16bit(0);
    
        //Configure the access timing for CS2 space
        Emif1Regs.ASYNC_CS2_CR.all =  ( EMIF_ASYNC_ASIZE_16    | // 16Bit Memory Interface
                                        EMIF_ASYNC_TA_1        | // Turn Around time of 2 Emif Clock
                                        EMIF_ASYNC_RHOLD_1     | // Read Hold time of 1 Emif Clock
                                        EMIF_ASYNC_RSTROBE_4   | // Read Strobe time of 4 Emif Clock
                                        EMIF_ASYNC_RSETUP_1    | // Read Setup time of 1 Emif Clock
                                        EMIF_ASYNC_WHOLD_1     | // Write Hold time of 1 Emif Clock
                                        EMIF_ASYNC_WSTROBE_4   | // Write Strobe time of 1 Emif Clock
                                        EMIF_ASYNC_WSETUP_1    | // Write Setup time of 1 Emif Clock
                                        EMIF_ASYNC_EW_DISABLE  | // Extended Wait Disable.
                                        EMIF_ASYNC_SS_DISABLE    // Strobe Select Mode Disable.
                                       );
    
        DUTY = (long *)ASRAM_CS2_START_ADDR;
    
    
        while (1)
        {
            *DUTY = 0x35;
        }
    }

    Even if no external memory is connected physically on my 28379D, normally in my Memory Browser, I should be able to see data on the bus?

    Thank you.

  • electrocc,

    Can you clarify if you have a memory attached?

    You should see address-, control-, and data-bus activity for EMIF writes even if you do not have a memory attached.

    EMIF reads will only generate address- and control-bus activity because it is assumed that the external memory will drive the data-bus.  As such, the read data is considered to be undefined if no external memory is driving the data signals.

    -Tommy

  • Tommy,

    Thanks for your answer.

    No, I haven't memory attached. I just wanted to test a simple programm, to understand how EMIF works and the features of Code Composer.
    That's why it's strange, cause I can't see anything when I'm writing on the bus.

    Regards

  • Can you clarify the following observations?  They seem to conflict. 

    electrocc said:
    Datas pins are toggling (oscilloscope checking), so it's ok. But when I'm looking at memory address 0x10 0000, all I see is 0x0000

    electrocc said:
    That's why it's strange, cause I can't see anything when I'm writing on the bus.

    If you monitor the data pins with an oscilloscope, you should see pin activity during writes.  CCS itself is only able to report reads, and will not detect meaningful activity until you have an external memory.

  • Sorry if I wasn't clear.

    When I'm looking datas with an oscilloscope, pins D0-->D7 are toggling.(I can recognize 0x35), but on CCS, datas on address 0x100000 are always 0x0000.

    I thought we could see datas written on CCS, even if we haven't an external memory connected?

    So on CCS, we can see only reads data? 
    For debug it's easier if we can read sent datas.

    Regards

  • No, you can not see the read data in CCS unless you have an external memory device connected.

    Regards,

    Vivek Singh

  • Vivek Singh said:

    No, you can not see the read data in CCS unless you have an external memory device connected.

    t's not clear with you previous answer.

    Please just complete :

    - Without memory connected, can we see sent datas in CCS?Yes or no?
    - Without memory connected, can we see read datas in CCS?Yes or no? Normally it's no

    - With memory connected, can we see sent datas in CCS?Yes or no?
    - With memory connected, can we see read datas in CCS?Yes or no?

    Thanks

  • Any idea Vivek or Tommy?

    Thank you.

    Regards

  • Hi,

    - Without memory connected, can we see sent datas in CCS?Yes or no?

    Yes, you can write.

    - Without memory connected, can we see read datas in CCS?Yes or no?

    No

     With memory connected, can we see sent datas in CCS?Yes or no?
    - With memory connected, can we see read datas in CCS?Yes or no?

    Yes, for both.

    Regards,

    Vivek Singh

  • Thank you Vivek.

    Regards,