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.

TM4C129XNCZAD: LCD with External SDRAM using EPI

Part Number: TM4C129XNCZAD

Hello Everyone,

I am using extra SDRAM on my custom made board with TM4C129X microcontroller.

As data sheet mentioned

 When using the LCD with EPI to interface to external memory, the external code address
space 0x1000.0000 must be selected by programing the ECADR field to 0x1 in the EPI
Address Map (EPIADDRMAP) register at EPI offset 0x01C.

I am initializing EPI and LCD module as follow:

uint16_t *frambuffer;

void EPI_Init(void)
{
SYSCTL_RCGCEPI_R = 1;
EPI0_BAUD_R = 1;
EPI0_CFG_R = 0x00000011;
while(EPI0_STAT_R & (1<<6));
EPI0_SDRAMCFG_R = (0x3<<30)|(940<<16)|(1);
EPI0_ADDRMAP_R = 0xD<<8|0xC;
frambuffer = (uint16_t *)0x10000000;

}

void LCDInit(void)
{
SYSCTL_RCGCLCD_R = 1;
LCD0_CLKEN_R = 0x07;
LCD0_CTL_R = (5<<8)| 3;
LCD0_RASTRCTL_R = (2<<20) | (1<<7) ; //0x00800080
// LCD0_RASTRCTL_R = (3<<25) | (2<<20) | (1<<7) ; //0x00800080
LCD0_RASTRTIM0_R = (0x7<<24)|(0x7<<16)|(0x3<<10)|(49<<4);
LCD0_RASTRTIM1_R = (0x8<<24)|(0x8<<16)|(0x3<<10)|(479);
LCD0_RASTRTIM2_R = (0x1<<25)|(0x1<<24)|(0x1<<22);
LCD0_DMACTL_R = 0x00000020;

LCD0_DMABAFB0_R = (uint32_t)frambuffer;
LCD0_DMACAFB0_R = (uint32_t)frambuffer+800*480*2-1;
}

But due to some reason my code is going into FaultISR Infinity loop.

Can someone suggest me why is this happening.

  • Hi,

      Have you single step your code to find out which line of code caused the fault? Please make sure the module that you are trying to access is enabled. If the module is not enabled and you are trying to read/write to its registers, it will cause fault. 

      You are also not using the TivaWare API but rather DRM (direct register manipulation) method to configure the modules. Using DRM will be prone to mistakes. 

      Please take a look at the lcd and epi examples at C:\ti\TivaWare_C_Series-2.2.0.295\examples\peripherals\epi\sdram.c and examples in C:\ti\TivaWare_C_Series-2.2.0.295\examples\peripherals\lcd directory.