cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO with voltage translator buffer

relaxe
Associate II
Posted on November 11, 2008 at 11:46

SDIO with voltage translator buffer

1 REPLY 1
relaxe
Associate II
Posted on May 17, 2011 at 12:51

Hi all!

I've spent the last week debuggin the SDIO peripheral, connected to a voltage level translator buffer. I'm writing this to share my knowledge, and maybe aquire hintfull sugestions.

We use a STM32F103ZET6 at 2.0V, with pull-ups on: CMD A0 A1 A2 A3.

Then, the SDIO port is connected trough a FXL2SD106 from Fairchild (similar to the TXB0108 from TI), and straight to the SD socket.

The example application, in this situation, is not working very well. The buffer sometime initialize in the wrong states, making various in-between voltages as two drivers seems to push the lines simultaneously.

My solution is to initialize the SDIO pins as OUT_PP and SET them before re-configuring them to AF_PP and initializing the SDcard.

Anybody got a better understanding / better solution?

Here is the code:

//////////////////////

// GPIOC and GPIOD Periph clock enable

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD, ENABLE);

// Configure PC.08, PC.09, PC.10, PC.11, PC.12 pin: D0, D1, D2, D3, CLK pin

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

GPIO_Init(GPIOC, &GPIO_InitStructure);

// Configure PD.02 CMD line

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;

GPIO_Init(GPIOD, &GPIO_InitStructure);

GPIO_WriteBit(GPIOC, GPIO_Pin_8, Bit_SET);

GPIO_WriteBit(GPIOC, GPIO_Pin_9, Bit_SET);

GPIO_WriteBit(GPIOC, GPIO_Pin_10, Bit_SET);

GPIO_WriteBit(GPIOC, GPIO_Pin_11, Bit_SET);

GPIO_WriteBit(GPIOC, GPIO_Pin_12, Bit_SET);

GPIO_WriteBit(GPIOD, GPIO_Pin_2, Bit_SET);

PowerConfig(V33,ON); //Turn on V33 for SDCard

OutputTca6424(1); //Activate the BUFFER's ENABLE pin.

// Configure PC.08, PC.09, PC.10, PC.11, PC.12 pin: D0, D1, D2, D3,CLK pin

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

GPIO_Init(GPIOC, &GPIO_InitStructure);

// Configure PD.02 CMD line

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;

GPIO_Init(GPIOD, &GPIO_InitStructure);

SDCard_Init();