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.

TMS570LS3137: help to program for EMIF

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Dear e2e,

I am trying to do EMIF program in tms570ls3137.  I am new to this controller. I am not getting any idea to how do program EMIF.  

using emif_ASYNC1Init(); function i generate a clock and data but i won't generate a required a clock (clock between 50MHz to 10Mhz)..

#include "sys_common.h"
#include <stdio.h>
#include <stdbool.h>
#include "sci.h"
#include "het.h"
#include "system.h"
#include "emif.h"
#include "rti.h"

/* USER CODE BEGIN (1) */

uint8_t DpramReadData = 0,DpramWriteData = 0;
uint16_t DpraAdress = 0;
extern uint32_t Time1Sec;
#define DPRAM_SYNC1 ((volatile uint32 *)(0x60000000U))


#define DPRAM_CNTENB_ON hetREG1->DOUT |= 0X00000080
#define DPRAM_CNTENB_OFF hetREG1->DOUT &= ~(0X00000080)
#define DPRAM_CNTRST_ON hetREG1->DOUT |= 0X00000200
#define DPRAM_CNTRST_OFF hetREG1->DOUT &= ~(0X00000200)

#define DPRAM_ADSB_ON hetREG1->DOUT |= 0X40000000
#define DPRAM_ADSB_OFF hetREG1->DOUT &= ~(0X40000080)
#define DPRAM_FTBPIPE_ON hetREG1->DOUT |= 0X80000200
#define DPRAM_FTBPIPE_OFF hetREG1->DOUT &= ~(0X80000200)
/* USER CODE END */
/* USER CODE BEGIN (2) */
/*********************************************************************
* ****Function Name : fputc
* ****Description : Serial Data send through Serial channel
**********************************************************************/
int fputc(int ch, FILE *f)
{
while ((scilinREG->FLR & (uint32)SCI_TX_INT) == 0U) // wait untill TXRDY bit is set to high
{
}
scilinREG->TD = ch; // Laod value into sci data register
return ch;
}
/*********************************************************************
* ****Function Name : sciDisplayData
* ****Description : Iconvert sting to integer
**********************************************************************/
void sciDisplayData(sciBASE_t *sci, uint8 *text,uint32 length)
{
uint8 txt = 0;
uint8 txt1 = 0;
while(length--)
{
#if ((__little_endian__ == 1) || (__LITTLE_ENDIAN__ == 1))
txt = *text--;
#else
txt = *text++;
#endif
txt1 = txt;
txt &= ~(0xF0);
txt1 &= ~(0x0F);
txt1 =txt1>>4;
if(txt<=0x9)
{
txt +=0x30;
}
else if(txt > 0x9 && txt < 0xF)
{
txt +=0x37;
}
else
{
txt = 0x30;
}
if(txt1 <= 0x9)
{
txt1 +=0x30;
}
else if((txt1 > 0x9) && (txt1 <= 0xF))
{
txt1 +=0x37;
}
else
{
txt1 = 0x30;
}
while ((scilinREG->FLR & 0x4) == 4); /* wait until busy */
sciSendByte(scilinREG,txt1); /* send out text */
while ((scilinREG->FLR & 0x4) == 4); /* wait until busy */
sciSendByte(scilinREG,txt); /* send out text */
};
}
void Delay1Ms(uint32_t Delay)
{
while(Time1Sec >= Delay );
Time1Sec = 0;
}
/*********************************************************************
* ****Function Name : EMMIFdataWrite
* ****Description : Generate EMIF data write
**********************************************************************/
void EMMIFdataWrite(uint32_t offset,uint16_t DpramWriteData)
{

DPRAM_CNTENB_ON;
DPRAM_CNTRST_ON;
*(DPRAM_SYNC1 +offset) = DpramWriteData;

}

/*********************************************************************
* ****Function Name : EMMIFdataWrite
* ****Description : Generate EMIF data write
**********************************************************************/
uint16_t EMMIFdataRead(uint32_t offset)
{

DPRAM_FTBPIPE_OFF; // DPRAM in flow-through mode operation,
DPRAM_CNTENB_OFF; //
DPRAM_CNTRST_OFF;

DpramReadData = *(DPRAM_SYNC1 +offset) ;
return DpramReadData;
}

/*********************************************************************
* ****Function Name : HardwareInit
* ****Description : PHERIPHERAL initialization
**********************************************************************/
void HardwareInit(void)
{
sciInit(); // Serial Communication Interface Initialization // High end Timer Initialization
hetInit();
rtiInit();
_enable_IRQ();
rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
rtiStartCounter(rtiCOUNTER_BLOCK0);
emif_ASYNC1Init();
}

/*********************************************************************
* ****Function Name : main
* ****Description :
**********************************************************************/
int main(void)
{
/* USER CODE BEGIN (3) */

uint16_t DpramData = 0;
HardwareInit();

while(1)
{
Delay1Ms(1000);
printf("***********************\n\r");
// DpraAdress = (0xAAA <<1);
// EMMIFdataWrite(0x000,0xAA);
// Delay1Ms(10);
DpramData = EMMIFdataRead(0x000);
// sciDisplayData(scilinREG,&DpramData,2);
}

plz help me ...

if you have some EMIF_interfacing code plz attach

  • Hello Prasanna,

    I've forwarded your post to one of our SW team members. They should get back with you soon.
  • Hi Prasanna,

    We do have an example in HALCoGen which shows how to configure EMIF to interface to an SDRAM. Currently it is part of TMS570LC43x/RM57x device. But still you can do similar steps for TMS570LS3137 device as well. Please take a note on the Pinmux settings.

    As of today we do not provide any examples with ASYNC memories. I can check with my teammates whether they have developed any sample code. Meanwhile, please take a look at the example (it is part of HALCoGen help document) and see whether it helps. Let me know if you still face any issues.

    Thanks and Regards,

    Veena