SC Card with SSP

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SC Card with SSP

711 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cto4260 on Sat May 30 11:50:35 MST 2015
Hey,

I want to use an SD Card with my LPC4337. The code, which is use works on another board with the same LPC, the same SD Card and the same Card holder. The only difference are the pins, which are used.

First(working) configuration:
MOSI
Chip_SCU_PinMuxSet(0x3, 7, (SCU_MODE_INACT  | SCU_MODE_FUNC5));
MISO
Chip_SCU_PinMuxSet(0x3, 6, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN  | SCU_MODE_FUNC5));
Write Protect
Chip_SCU_PinMuxSet(0x3, 5, (SCU_MODE_INACT  | SCU_MODE_FUNC0));
Chip Detect
Chip_SCU_PinMuxSet(0x3, 4, (SCU_MODE_INACT  | SCU_MODE_FUNC0));
SCK
Chip_SCU_PinMuxSet(0x3, 3, (SCU_MODE_INACT  | SCU_MODE_FUNC2));
SSEL
Chip_SCU_PinMuxSet(0x3, 8, (SCU_MODE_INACT | SCU_MODE_FUNC4));
Clocks M4_SSP0 & APB0_SSPO
Chip_Clock_Enable(CLK_MX_SSP0);
Chip_Clock_Enable(CLK_APB0_SSP0);
Bitrate 400kHz

New(non working configuration):
Chip Select
Chip_SCU_PinMuxSet(0x7, 4, SCU_MODE_FUNC0 | SCU_MODE_INACT);
MOSI
Chip_SCU_PinMuxSet(0x3, 8, (SCU_MODE_INACT  | SCU_MODE_FUNC2));
SCK
Chip_SCU_PinMuxSet(0x3, 3, (SCU_MODE_INACT  | SCU_MODE_FUNC2));
MISO
Chip_SCU_PinMuxSet(0x3, 7, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN  | SCU_MODE_FUNC2));
Write Protect
Chip_SCU_PinMuxSet(0x2, 13, (SCU_MODE_INACT  | SCU_MODE_FUNC0));
Chip Detect
Chip_SCU_PinMuxSet(0x7, 5, (SCU_MODE_INACT  | SCU_MODE_FUNC0));

One additional difference is, that we use a GPIO to select the chip instead of the SSL. The chip select drain on the card holder is always on 0V. Write Protect and Chip Select are an 0V, too. But this is not relevant I think.

On the MOSI and MISO drains I can measure the follwing signal: ( I am trying to init the Card a second time, when init fails).
[img]http://i.imgur.com/ZBBQTyI.png[/img]
[img]http://i.imgur.com/BiVYAqm.png[/img]


Can anyone find a failure in my initialisation of my pins? I am using LPCOpen for the standart initialisations. Im am wondering that this doesn't work, because it works's on another board...

Perhaps anyone has an idea, whats wrong.

Thank you,
Marvin
标签 (1)
0 项奖励
回复
0 回复数