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.

DSP 6416 EMIFA speed problem

Other Parts Discussed in Thread: TMS320C6416, TMS320C6414

Dear Sir,

I am using the TMS320C6416 - 720MHz DSK board. I am planning to connect the DSP to ADC/DAC in future board design and implementation. However, I have found some problem about the EMIF's maximum read/write speed.

We need a sampling speed of ADC and DAC at least of 30MHz. I have configured the EMIF control register to make it work at maximum speed (Asynchrous 32 bit, Write/Read Setup=Strobe=1 ECLKOUT, HOLD=0) and our ECLKOUT is 120MHz.. However, when I measure the output frequency of the data at the EMIF connector pin  using oscilloscope, I have found that the maximum frequency is only 16MHz. I also tried to change the Asynchronous to Synchronous 32-bit mode and set the read/write latency to 0 cycle, but the result is the same 16MHz maximum speed!

The output/input action through EMIF is conducted by Timer ISRs. Here is the code of the main program:

  EMIFA_Config MyConfigA =
  {
    0x00012060,  /* gblctl */    // ECLKOUT2 =  ECLKOUT1, clkout4,6 disable
    0x10418120,  /* CE-0 */    // 32-bit Async, Write/Read: setup=1, strobe=1, hold=0, TA=2 (ECLKOUT)
    0x10418120,  /* CE-1 */
    0x10418120,  /* CE-2 */
    0x10418120,  /* CE-3 */

    0x0248F000,    /* sdctl */
    0x005DC5DC, /* sdtim */
    0x00175F3F,    /* sdext */

    0x00000000,   /* cesec0 */
    0x00000000,   /* cesec1 */
    0x00000000,   /* cesec2 */
    0x00000000    /* cesec3 */
  };

  TIMER_Config MyTimerConfig1 =
  {
    0x000003C1,   /* ctl */  /* TSAT signal->TOUT pin, Clock mode */
    0x00000002,   /*  22 MHz */
    0x00000000    /* cnt */
  };

#define OUTPUT 0xA0000000  // CE2 space for ADC/DAC access
int *output= (int*) (OUTPUT);

unsigned int data = 0;
interrupt void Timer1_ISR(void)
{  
   *(output) = data;
   if(data==0){
      data = 1;
   }
   else{
      data = 0;
   }

}

void main()
{
  EMIFA_config(&MyConfigA);
  hTimer1 = TIMER_open(TIMER_DEV1, TIMER_OPEN_RESET);
  TimerEventId_1 = TIMER_getEventId(hTimer1);
  IRQ_map(TimerEventId_1, 15);
 
  while(1){
    TIMER_config(hTimer1, &MyTimerConfig1);  
    TIMER_start(hTimer1); 
    IRQ_enable(TimerEventId_1);
    IRQ_nmiEnable();
    IRQ_globalEnable();
    while(1);
    IRQ_disable(TimerEventId_1);
    IRQ_globalDisable();
    IRQ_nmiDisable();
    *(unsigned int *) TIMER1_CTRL = 0x00000000; // Disable Timer1
  }
}

We need to use EMIF at minimum of 30MHz. However, When I set the Timer to work at higher than 16MHz, the EMIF output remains at 16MHz.. I donnot know whether I have done something wrong about the EMIF register setting, or the Timer ISR problem.. How can I achieve higher EMIF read/write speed(30MHz is ideally)  using this Timer ISR routine? I will greatly appreciate if anyone can help!

Sung Kim.

  • Sung Kim,

    To find out your best possible speed on the EMIF, change your outer while (1) loop to

    while (1)
    {
      *output=1;
      *output=0;
    }

    Then you can try smaller numbers for setup, strobe, write, and turnaround, if you want to.

    You may be experiencing delays from the timer to the interrupt to the ISR to the *output=data line and then returning from the interrupt. Running the code I list above may give you a little faster throughput, but I have not tested it for you. Please let me know what you find with this.

    Regards,
    RandyP

  • RandyP,

    Thank you very much for your quick reply!

    I have experimented the way you listed above to test the best possible speed on the EMIF, using the way:

    #define OUTPUT 0xA0000000   // CE2 space for ADC/DAC access
    int *output= (int*) (OUTPUT);

    void main()
    {
      EMIFA_config(&MyConfigA);

      while (1)
      {
         *output=1;
         *output=0;
      }

    }

    However, when I observed the output (ED0 pin on EMIF connector of 6416DSK) on the oscilloscope, no signal was displayed.. (The oscilloscope we used is Agilent 4G Sa/s). I am not sure whether it is because the DSP execution speed is too fast ( DSP6416 720MHz) such that the oscilloscope could not catch the signal. Thus, I also tried another way as below:

    interrupt void Timer1_ISR(void)
    {  
       *output = 1;
       *output = 0;

    }

    void main()
    {
      EMIFA_config(&MyConfigA);
      hTimer1 = TIMER_open(TIMER_DEV1, TIMER_OPEN_RESET);
      TimerEventId_1 = TIMER_getEventId(hTimer1);
      IRQ_map(TimerEventId_1, 15);
     
      while(1){
          TIMER_config(hTimer1, &MyTimerConfig1);  
          TIMER_start(hTimer1); 
          IRQ_enable(TimerEventId_1);
          IRQ_nmiEnable();
          IRQ_globalEnable();
          while(1);
      }
    }

    However, I still observed no signal displayed on the oscilloscope.. I have no idea whether it is because the DSP execution speed is too fast such that the EMIF output signal cannot be captured by the oscilloscope, or no signal changes has occurred on the EMIF because of the high signal change speed conducted by the DSP..

    I also tried smaller numbers for SETUP, STROBE, HOLD and Turnaround as SETUP=STROBE=1, HOLD=0, Turnaround=0 (in unit of ECLKOUT- 120MHz), I think these are the minimum number. But the result is the same: The maximum EMIF output speed I observed on oscilloscope remains 16MHz..  

    In addition, I also tried to make the EMIF work at Synchronous mode (MTYPE = 0100, 32bit SBSRAM) as you have recommended in another post, but the result was the same.. I have noticed that Francesco Annese (http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/112/p/116968/417074.aspx#417074) has found that the connector on DSK only provides access to asynchronous EMIF signals such that the synchronous mode cannot be observed on the EMIF connector.. I am not sure whether it is the reason why I observed no difference when I changed the EMIF to work at synchronous mode.. Could you please show how to make the EMIF work at synchronous mode normally to achieve higher data transfer speed (e.g. 30MHz)

    I believe that you are right about the considerations that the delay from timer to interrupt to ISR to return back could cost much to reduce the throughput. But the operations I have put in the ISR is only one line ( *output = 1 or 0).  I wonder that even in this simplest operation, the timer and ISR could still affect the EMIF speed so much? I think we need the timer and ISR to access the AD/DA.. I will greatly appreciate if you could give any advice about some more efficient way to operate the timer and ISR such that the EMIF speed could be less affected.

    Sincerely many thanks

    Regards,

    Sung Kim


     

  • Sung Kim,

    Do you use optimization? If yes, then you may need to change the line

    Sung Kim said:
    int *output= (int*) (OUTPUT);

    new said:
    volatile int *output= (volatile int*) (OUTPUT);

    If you do not use optimization, then there must be some small bug in the program, but it is not obvious to me what it would be. You would use CCS and emulation to determine this.

    For using the DSK6416 daughtercard connector in synchronous mode, you will need to do the same examinations that the other poster did with the DSK6455. The schematic and Technical Reference will have information you need to determine which modes you can use.

    Regards,
    RandyP

  • RandyP,

    Thanks you very much for your instructions! As you have thought- I have used the optimization (-o3) in the previous experiments. I modified the code as you suggested like:

    volatile int *output =(volatile int *)(OUTPUT);

    And this time I have observed the signal on the oscilloscope!  I measured the frequency of the EMIF output signal ( change between 0 and 1 on the ED0 pin of the EMIF connector) and I see the frequency is 16MHz ! At the same time I also measured the ECLKOUT as 120MHz. I think this is the maximum speed on the EMIF currently.( no timer, no ISR, just output directly to the EMIF connector). But I think I have set the EMIF control register to make it work at maximum speed ( 0x10418120,  /* CE-1 to CE-3 */    // 32-bit Async, Write/Read: setup=1, strobe=1, hold=0, TA=2 ,ECLKOUT). But the speed I obtained is not the supposed :120MHz/(1+1+1)=40MHz, but only 16MHz.. I cannot understand why.. could you please give me some advice about the reason of this result? Or, this is the normal result- 16MHz is the maximum speed when the ECLKOUT is 120MHz?

    Thanks a lot and waiting for your reply

    Regards,

    Sung Kim 

  • Sung Kim,

    So it will be clear to me, what are you measuring on the ED0 pin? Is 16MHz the frequency of the square-wave output or the rate from one edge to the next?

    What do the CEn and AWEn signals look like on a scope, showing two pulses if possible?

    If the timing values, setup, strobe, hold, TA, are all set to their minimum values, then you are seeing the maximum rate. Can you lower any of the values below their current values without violating a specification?

    Regards,
    RandyP

  • RandyP,

    Glad to see your reply!

    However, I think I understand what you mean in the above post. What I measured is the rate from one edge to the next (1 -> 0 , or 0 - > 1), or the duration of '1' or '0' lasted. If I have meant 16Mhz is the frequency of the square-wave, then the EMIF speed will be 16MHz x 2 =32MHz.. But what I saw on the oscilloscope was the rate of output frequency of ED0 pin on the EMIF connector.

    Since the experiment devices are in use by others now, I will show you the CEn and AWEn signal capture in the next post as soon as possible.

    The timing values: SETUP, STROBE, HOLD, TA I have set were 1,1,0,0 (in units of ECLKOUT). I think these are the minimum values possible and I cannot lower them anymore(I referenced the C6000 workshop materials). I also tried them set as 0, 0, 0, 0, but the result was the same as they were 1,1,0,0.

    I have been trying to make EMIF to work on Synchronous mode, but I still could not make it. I have thought it is the problem of the buffer connected to the EMIF connector problem.. I measured the input signal to the buffer (that is the direct output from the DSP EMIF data port), but I observed the same result on the EMIF connector.. So I think it may be the DSP that it doesnot work on the synchronous mode.. Could you please show  how to make the EMIF work on synchronous mode?

    Thanks a lot!

    Regards,

    Sung Kim

     

  • Sung Kim,

    From the other post that you referenced, it appears that the board and CPLD do not permit the operation of EMIFA in synchronous mode. The EMIFA can operate that way, but this board does not support that mode of operation without doing a lot of your own custom engineering.

    Your best choice may be to search the web for other C6416 development boards that might allow you to test this mode.

    On the DSK6416, the EMIFB is configured for SDRAM which is one of the Synchronous modes. Very similar settings copied to EMIFA would put it into SDRAM mode, although it would not be supported by the board in this case.

    I know this does not directly help your current situation, but I hope it helps to make the options clear.

    Regards,
    RandyP

  • RandyP,

    Thank you very much for your advice.

    In fact, I have succeeded in making the EMIF work at Synchronous mode with maximum write/read speed upto the ECLKIN frequency(ECLKIN frequency is 100MHz on our customized DSP board). I have been working on the DSP board (TMS320C6414) designed by us, instead of the DSK6416 board. And on our board, there is no EMIF connector like that in DSK6416 board. However,  I only make the EMIF work at Synchronous mode using the EDMA transfer method. When using EDMA, I could achieve data transfer speed at EMIF maximum speed (that is the ECLKOUT frequency which is equal to ECLKIN in Synchronous mode). But if I tried to transfer data using CPU initiated method instead of EDMA , whichis like *output=0x000000001 (wirte to EMIF), or adc_in=*output  (Read from EMIF ) (*output is mapped to the CE2 space :0xA0000000), then I could only achieve very slow read/write speed (write speed upto about 16MHz, and read speed upto about 7MHz in my test). So I think that the EDMA transfer method is the correct choice under requirement of  high transmission speed.

    Thank you very much for your valuable advices which helped me a lot

    Thanks again!

    Sincerely,

    Sung Kim