AnsweredAssumed Answered

SPI MISO problem

Question asked by mathiasmeier.mic.002 on Nov 23, 2013
Latest reply on Nov 24, 2013 by Clive One
I know this is weird, but any help would be great. This is driving me nuts.

I'm tyring to use A5, A6 and A7 as SPI for communication with a touchscreen controller. SCLK and MOSI work fine, but MISO (A6) works only the first time and then becomes active high thereafter? What could cause this? I have included the configuration code.

Thanks,


 

// enable clock for used IO pins

 

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA,

ENABLE);

 

 

 

/* configure pins used by SPI1

 

* PA5 = SCK

* PA6 = MISO

* PA7 = MOSI

*/

GPIO_InitStruct.

GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_6 | GPIO_Pin_5;

 

GPIO_InitStruct.

GPIO_Mode = GPIO_Mode_AF;

 

GPIO_InitStruct.

GPIO_OType = GPIO_OType_PP;

 

GPIO_InitStruct.

GPIO_Speed = GPIO_Speed_25MHz;

 

GPIO_InitStruct.

GPIO_PuPd = GPIO_PuPd_UP;

 

GPIO_Init(GPIOA, &GPIO_InitStruct);

 

 

// connect SPI1 pins to SPI alternate function

 

GPIO_PinAFConfig(GPIOA, GPIO_PinSource5, GPIO_AF_SPI1);

GPIO_PinAFConfig(GPIOA, GPIO_PinSource6, GPIO_AF_SPI1);

GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_SPI1);

Outcomes