Question
No MOSI PULSE if use SPI re-mapped
Posted on February 28, 2013 at 04:03
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-mapped