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.

TM4C129ENCPDT: EPI Refresh Configuration

Part Number: TM4C129ENCPDT

Hello (again)

I'm interfacing to an 8MB / 64Mbit SDRAM and was hoping someone could confirm my understanding of the refresh counter value that is passed to EPIConfigSDRAMSet() please.

I have a 25MHz XTAL and using the PLL to generate a 120Mhz system clock frequency.

I set the divider of 1 so the EPI Clk = (120MHz / (((1 / 2) + 1) * 2) = 40MHz It states in the docmentation that a divider value of 1 results in an EPI clock rate of half the system clock 40MHz != 120MHz / 2 but instead a third of the system clock.

Using 40MHz I get:

RFSH = 64000 / 4096 = 15.625 / 0.025 = 625

My call to EPIConfigSDRAMSet() is therefore:

MAP_EPIConfigSDRAMSet(EPI0_BASE, (EPI_SDRAM_CORE_FREQ_30_50 | EPI_SDRAM_FULL_POWER | EPI_SDRAM_SIZE_64MBIT), 625);

However if it were 60MHz (120MHz / 2)

RFSH = 64000 / 4096 = 15.625 / 0.016 = 937

And my call to EPIConfigSDRAMSet() would now be:

MAP_EPIConfigSDRAMSet(EPI0_BASE, (EPI_SDRAM_CORE_FREQ_50_100 | EPI_SDRAM_FULL_POWER | EPI_SDRAM_SIZE_64MBIT), 937);

The interface is configured sufficiently that I can run a march test over the entire SDRAM using either configuration which worries me especially given the warning that "If a number larger than allowed is used, the SDRAM is not refreshed often enough, and data is lost".

Thanks,

HL

  • The formula in the TivaWare documentation (section 11.2.2.11) is a bit confusing. It is using an integer divide such that 1/2 = 0. It would be more clear if written:

    EPIClk = (Divider == 0) ? SysClk : (SysClk / (((Divider >> 1) + 1) x 2))

    Therefore a call to EPIDividerSet(EPI0_BASE, 1) with a system clock of 120MHz would give an EPI clock of 60MHz. 

  • Of course it is! SMH. Thanks Bob