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.

Interface C6455 to FPGA via EMIF

Hi. I'm new to the TI-DSP-World.

I want to move Data (50 Bits) to an FPGA (Spartan 6) via EMIFA cyclic without EDMA. I want to trigger the data transfer over a timer interrupt every 5us. I'm using the c6455 single core DSP. First I want to deal with the EMIFA to get a connection to the FPGA. It is not necessary to get data from the FPGA.

I want to use the CSL functions and macros.

Is there some example code to get startet with the EMIF?

  • Hello!

    Your task breaks in two: 1) interface configuration; 2) data exchange. The latter one is trivial when the former is done. EMIF has an address window, accesses to which are translated into bus cycles on the interface. So from program perspective you do loads and stores of data to EMIF's address. You may want to look at something like CONTENTS_OF macro and probably adjust to your needs, e.g. give some friendly name. So in you code that might look just like FPGA_WRITE( foo );

    However, before you get there, a lot of preparation work should be done. First of all, you have to configure your EMIF in desired mode. Asynchronous memory interface with programmable phases is an easiest to my understanding. I could share some examples just to give you idea how that looks like, but mine device was C6414, so you'll have to change a lot.

    Another big issue is FPGA side. You better talk to you FPGA designer if that's not you. You also may want to read this appnote

    http://www.xilinx.com/support/documentation/application_notes/xapp753.pdf

    .

  • Hi!
    Thank you for your fast and helpful reply.
    I started to configure the EMIFA. I configured the EMIFA in asynchronous mode.

    I will care about the FPGA after I can clock out some data out of the dsp. Thank you for the application note by the way. This is very helpful.

    By now I'm so far:

    #include "config_EMIFA.h"
    int main(void)
    {
    CSL_init();
    CSL_Status status;
    status= CSL_emifaInit(NULL);

    CSL_EmifaObj emifaObj;
    CSL_EmifaHandle hEmifa;

    ????hEmifa = CSL_emifaOpen(&emifaObj, CSL_EMIFA, NULL, &status);???

    status=CSL_emifaSetupRaw(hEmifa,&MyEMIFAConfig);

    }

    #ifndef CONFIG_EMIFA_H_
    #define CONFIG_EMIFA_H_

    static EMIFA_config MyEMIFAConfig ={
    /* EMIFA Status Register */
    EMIFA_FMK(STAT,BE, 0) // little endian mode

    /* EMIFA Burst Priority Register */
    EMIFA_FMK(BPRIO,PRIO_RAISE,FFh) //FIFO feature disabled, commands stay in command fifo idefinitely

    /* EMIFA CEn Configuration Registers Register */
    EMIFA_FMK(CEnCFG,SSEL,0) // Asynchronous memory mode
    EMIFA_FMK(CEnCFG,SS,0) // Strobe mode disabled
    EMIFA_FMK(CEnCFG,BWEM,0) // WE Strobe mode disabled
    EMIFA_FMK(CEnCFG,AE,0) // ARDY disabled
    EMIFA_FMK(CEnCFG,W_SETUP,1) // same configuration as in Figure 8 and 9 in sprue971 Timing Diagramm
    EMIFA_FMK(CEnCFG,W_STROBE,2) //
    EMIFA_FMK(CEnCFG,W_HOLD,0) //
    EMIFA_FMK(CEnCFG,R_SETUP,1) //
    EMIFA_FMK(CEnCFG,R_STROBE,2) //
    EMIFA_FMK(CEnCFG,R_HOLD,0) //
    EMIFA_FMK(CEnCFG,ASIZE,2) // 32 bit data bus

    /* EMIFA Interrupt Mask Set Register */
    EMIFA_FMK(INTMSKSET,AT_MASK_SET,0) //Asynchronous access timeout interrupt is disabled

    /* EMIFA Interrupt Mask Set Register */
    EMIFA_FMK(INTMSKCLR,AT_MASK_CLR,0) // Asynchronous acess timeout interrupt is disabled

    };

    #endif /*CONFIG_EMIFA_H_*/


    I have some trouble with the function CSL_emifaOpen(). I can not find Documentation for the arguments of this function. Can I set up the address over these arguments?

    How can I pass data over this handle and where do they go?(which adress?, which pin?)

    Thank you!
  • Hello, Patrick,

    As mine experience was with different processor and library version, I would refrain giving you direct instructions. However, you may find a good example made by TI. As long as you able to deal with CSL, I suppose you have it installed already, but just in case, refer

    http://www.ti.com/tool/sprc234

    .

    Inside those deliverable please find 03.00.10.02\6455\default_package\csl_c6455\example\emifa\src\Emifa_ReadWrite_example.c It will give you idea how to deal with the interface setup.

    As to the last question, again, you will find the reference in the mentioned example, here let me give you just basic idea. First, refer to the data manual on your device

    http://www.ti.com/lit/ds/symlink/tms320c6455.pdf,

    Table 2-2 with memory map.

    It tells EMIFA CE2 A000 0000 - A07F FFFF. In other words, whenever you try to write something at address withing that window, EMIFA will execute write cycle on the bus, if you are truing to read something from that window - the bus will take read cycle. So if you have something like unsigned *pdata = (unsigned *)0xA0000000, then pdata[0] =  foo; will issue write cycle, and value on the data bus would be foo. If you try bar = pdata[1]; then EMIF will execute read cycle and load to bar value of the word with offset one, that is address bus would have word address 1.

    Next I suggest to refer

    http://www.ti.com/lit/ug/spru971e/spru971e.pdf

    . There you will find description of data bus, address bus and control signal names, as well as timing diagrams of the access cycles.

  • Thank you very much, you really helped me! I'm able to write data out of the dsp. I will care about the fpga side now.