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.

RTOS/66AK2H14: EMIF address shifting

Part Number: 66AK2H14

Tool/software: TI-RTOS

Hi,

66AK2H14 is interfaced to Altera MAX10 series CPLD through EMIF16 interface.

EMIF16 is configured to Select Strobe Mode.We have to perform CPLD read/write through EMIF16.

I have posted one query about how to configure  control lines of EMIF. here is the link of my previous post

I have to write 4096 bytes of data from the position 0000 to 4095.

I am writing to EMIF as ,

#define CPLD_DATA_ADDR          0x0034000000

 data_addr = ( uint16_t *)CPLD_DATA_ADDR;

          /* 8-bit flash */
     while(i++  < SIZE)
     {
      if(j==256)
          j=0;
      *data_addr = cmp_val[j++];
      data_addr++;

     }

as per the previous post , The address lines are carried though from the lower address bits of the memory map with the shift.

When I signal tap the address line which goes to CPLD  I am getting address like 000000 , 800000 , 000001 etc which I have to right rotate to get the correct address.

I have attached the screenshot for your reference.

My doubt is Whether this rotation has to be  done by the master(66ak2h14)  while writing to 0x34000000 or by the slave(CPLD)?

  • Hi,

    Which Processor SDK RTOS version are you using?

    Best Regards,
    Yordan
  • Hi,
    Which Processor SDK RTOS version are you using?
    processor_sdk_rtos_k2hk_4_03_00_05

    Regards,
    Mahima Shanbag
  • Hi Mahina,

    Can I get a few clarifications? Your code includes the comment /* 8-bit flash */. Are you connecting to an 8bit device or a 16bit device? Are you configuring the EMIF for x16bit operation?  The logic analyzer capture is showing the addresses as CP_EMIF16_A[23..0]. Are the lines connected to the EMIF signals on the K2H based on those signal names? In other words, is CP_EMIF16_A0 connected to EMIFA00 on pin F34? 

    You were speculating on the rotation of the addresses. As specified in the EMIF16 users guide, the signal for the least significant address will appear on EMIFA23 in x16bit mode. That is why you have to connect EMIFA23 to the A0 line on your memory device. EMIFA0 would be connected to A1 on your memory device, etc. The K2H does not internally shift the addresses to support the memory bus width you have selected.

    Regards, Bill

  • Hi Bill,

    Thank you for your suggestion. I am able to read/write to CPLD.

    I have another question,

    We have to achieve maximum throughput , for that I reduced the setup , strobe, hold cycles to 1,5,1 respectively.

    I am able to read/write with above configuration.

    When I signal tap the read operation I can see delay between 2 read and it is taking nearly  23 cycle for another read.

    I have attached the screen shot for your reference.

    I am reading 4096 locations and my read function is

     static uint32_t cpldReadDataBytes()
     {
         uint16_t  *data_addr;
         uint16_t i=0;

         data_addr = (uint16_t *)CPLD_DATA_ADDR;

         while(i<SIZE)
         {

             pBuffer[i++]=*data_addr++;
         }
         return 0;
     }

    Q1. Why that delay is incured?How to reduce that delay ?

    Thanks and Regards,

    Mahima Shanbag

  • Hi Mahima,

    The EMIF16 was not designed for streaming data into or out of the device but there are some changes to the method of data transfer that will reduce the delay. The code you've included must initiate a transfer within the EMIF16 for each access to the memory and there is a delay associate with that setup and with the code to perform the while loop. In which memory area is pBuffer located? There is also a delay associated with taking the data read from the EMIF and writing it to pBuffer. A better method is to use a EDMA transfer to access the EMIF16 internally using consecutive 32bit reads. The EMIF16 will break the 32bit accesses into two individual 16bit external accesses. The EMIF16 is the same as the one used on previous KeyStone parts. The links below have some very good information on optimizing the data transfer.

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/192245?tisearch=e2e-quicksearch&keymatch=emif%20throughput#pi316458=1

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/339211

    Regards, Bill

  • Hi Mahima,
    I'm going to close this thread since you have your board working. You can reopen the thread if you have more questions.
    Regards, Bill