cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F427 SPI HAL MXCube

john239955_st
Associate III
Posted on April 21, 2016 at 16:24

Hi,

I believe I have a problem with SPI bus.

I have set the SPI bus to set up and receive data from a ADC.

First off I have configured IO Pins to Clock Data from the ADC using PA5 - SClk, PA6 as MISO and PA7 as MOSI and works fine for all 8 channels albeit slow.

I have reconfigured using MX Cube to configure the SPI bus.

The code fragment is as below:-

              // Code to wait for D_Ready;

              Set_CS(P_LOW);   // Set CS low on ADC

                                               

HAL_StatusTypeDef status = HAL_SPI_Receive(&hspi1, SPI1_Data_Read_ADC1, 4, 1000);  

                                                        

               if(status != HAL_OK) { return status; };                                             

                                             

                                                

                                                        

           Set_CS(P_HIGH);   // Set ADC CS High

This runs OK with Receive set to 4 bytes if I incease to 5 bytes the SPI stops clocking, I have an Oscilloscope(pico) on the Data, Clock and D_Ready and CS and all seems normal with 4 bytes but the SClk stop with 5 bytes +.

Changing CPOL, Edge and Baud rate has no effect.

Any help would be appreciated.  Thanks John W

 
1 REPLY 1
john239955_st
Associate III
Posted on April 25, 2016 at 12:02