Quote:
On that board the sdio_clk signal comes out on PC_0 which is not muxed with any of the EMC clocks so you should be fine. Of course you will need to configure the function of this pin to be the SDIO_CLK.
I have a similar setup with a LPC4337, external SDRAM (EMC) and SD card and need clarification regarding the CLK configuration:
Per UM10503:
All four EMC_CLK clock signals must be configured for all SDRAM devices
independently of their size by selecting the EMC_CLK function and enabling the input
buffer (EZI = 1) in all four SFSCLKn registers in the SCU.
Code:
Chip_SCU_PinMuxSet( 6, 11, (SCU_PINIO_FAST | SCU_MODE_FUNC3)); // CKEOUT0
Chip_SCU_ClockPinMuxSet(0, (SCU_PINIO_FAST | SCU_MODE_FUNC0)); // CLK0 connected to EMC_CLK0
Chip_SCU_ClockPinMuxSet(1, (SCU_PINIO_FAST | SCU_MODE_FUNC0)); // CLK1 connected to EMC_CLK1
Chip_SCU_ClockPinMuxSet(2, (SCU_PINIO_FAST | SCU_MODE_FUNC0)); // CLK2 connected to EMC_CLK3
Chip_SCU_ClockPinMuxSet(3, (SCU_PINIO_FAST | SCU_MODE_FUNC0)); // CLK3 connected to EMC_CLK2
My SD Card configuration based on the SDMMC example and board.c:
void board_SDMMC_init(void)
{
Chip_SCU_PinMuxSet(0xC, 4, SDIO_DAT_PINCFG); /* PC_4 connected to SDIO_D0 */
Chip_SCU_PinMuxSet(0xC, 5, SDIO_DAT_PINCFG); /* PC_5 connected to SDIO_D1 */
Chip_SCU_PinMuxSet(0xC, 6, SDIO_DAT_PINCFG); /* PC_6 connected to SDIO_D2 */
Chip_SCU_PinMuxSet(0xC, 7, SDIO_DAT_PINCFG); /* PC_7 connected to SDIO_D3 */
Chip_SCU_PinMuxSet(0xC, 0, (SCU_PINIO_FAST_CLK | SCU_MODE_FUNC7)); // CKEOUT0
Chip_SCU_ClockPinMuxSet(2, (SCU_PINIO_FAST | SCU_MODE_FUNC4)); // CLK2 connected to SDIO_CLK
Chip_SCU_PinMuxSet(0xC, 10, SDIO_DAT_PINCFG); /* PC_10 connected to SDIO_CMD */
Chip_SCU_PinMuxSet(0xC, 8, (SCU_MODE_INBUFF_EN | SCU_MODE_FUNC7)); /* PC_8 connected to SDIO_CD */
}
This doesn't work, as
Chip_SCU_ClockPinMuxSet(2, (SCU_PINIO_FAST | SCU_MODE_FUNC4)); // CLK2 connected to SDIO_CLK
takes CLK2 away from EMC.
However, this does work fine:
void board_SDMMC_init(void)
void board_SDMMC_init(void)
{
Chip_SCU_PinMuxSet(0xC, 4, SDIO_DAT_PINCFG); /* PC_4 connected to SDIO_D0 */
Chip_SCU_PinMuxSet(0xC, 5, SDIO_DAT_PINCFG); /* PC_5 connected to SDIO_D1 */
Chip_SCU_PinMuxSet(0xC, 6, SDIO_DAT_PINCFG); /* PC_6 connected to SDIO_D2 */
Chip_SCU_PinMuxSet(0xC, 7, SDIO_DAT_PINCFG); /* PC_7 connected to SDIO_D3 */
Chip_SCU_PinMuxSet(0xC, 0, (SCU_PINIO_FAST_CLK | SCU_MODE_FUNC7)); // CKEOUT0
// Chip_SCU_ClockPinMuxSet(2, (SCU_PINIO_FAST | SCU_MODE_FUNC4)); // CLK2 connected to SDIO_CLK
Chip_SCU_PinMuxSet(0xC, 10, SDIO_DAT_PINCFG); /* PC_10 connected to SDIO_CMD */
Chip_SCU_PinMuxSet(0xC, 8, (SCU_MODE_INBUFF_EN | SCU_MODE_FUNC7)); /* PC_8 connected to SDIO_CD */
}
My question... is this OK? Don't I need to ClockPinMux the clock signal to SD_CLK? Is it enough to assign the SD_CLK FUNC to PC_0?
Thank you.