We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I'm using a MCBSTM32E board, with a ST32E103ZE Arm Cortex M3 processor. I am trying to get the SPI interface to work, but so far I've had no luck.
I've tried simulating, and capturing the pin outputs with an oscilloscope, but I get no output.
Relevant code:
void M_SPIInit(void) { SPI_InitTypeDef SPI_InitStructure; // SPI1 configuration SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; SPI_InitStructure.SPI_Mode = SPI_Mode_Master; SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_High; SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Hard; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 7; SPI_Init(SPI1, &SPI_InitStructure); } int main (void) { stm32_Init(); M_SPIInit(); SPI_Cmd(SPI1, ENABLE); SPI_I2S_SendData(SPI1,word); }
Yes, it is.
But it contains special character sequences (in comments) that are spotted by the Wizard.
where did you obtain the stm32_init.c file?
In the Install folder, under examples\boards\Keil\MCBSTM32E
Some the examples have it.
Keil\ARM\Boards\Keil\MCBSTM32E\Blinky
See: http://www.keil.com/support/docs/2735.htm - which includes a link to the appropriate section of the uVision Manual...