2013-02-27 07:03 PM
A am using STM32F103T4, a low density device, and want to use the re-mapped SPI1. Below is my implementation:
/* GPIO and AFIO clock enable */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO| RCC_APB2Periph_GPIOB, ENABLE); /* Enable SPI */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE); /*JTAG-DP Disabled and SW-DP Enabled */ GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE); //JTAG-DP Disabled and SW-DP Enabled /* Configure REmapped- SPI pins: SCK, MISO and MOSI */ GPIO_PinRemapConfig(GPIO_Remap_SPI1, ENABLE); //Configure SPI pins: SCLK=PB3, MOSI=PB5 GPIO_InitTypeDef GPIO_InitStructureB; GPIO_InitStructureB.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_5; GPIO_InitStructureB.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructureB.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructureB); //Configure SPI pins: MISO=PB4 GPIO_InitStructureB.GPIO_Pin = GPIO_Pin_4; GPIO_InitStructureB.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_Init(GPIOB, &GPIO_InitStructureB); GPIO_InitTypeDef GPIO_InitStructure;My problem is I have a clock pulse but no MOSI pulse. Do I have a missing code for MOSI on PB5 to work. kindly help. #spi-stm32f103 #spi-re-mapped2013-02-28 02:08 AM
GPIO_PinRemapConfig(GPIO_Remap_SPI1, ENABLE);
Best Regards,
ST.MCU
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-09-17 09:37 AM
The Mosi pin is conflicting with I2C1_SMBAl . Disable i2c and it will work !!