cancel
Showing results for 
Search instead for 
Did you mean: 

SPI to read ADS7953 with STM32F072 not working.

LSant.6
Associate II

Hello

I am developing a board to measure many voltages for a student project. On that board are a ADS7953, a ISO7741 and a STM32F072. Now I am at the end of my resources. I can't read anything useful from the ads. Btw I am using an ADS7953 EVAL Board, in case that makes a difference. Im under timepressure so quick inputs are appreciated too.

My setup:

I have set the gpio pins for the spi to highspeed aswell.

I will add my code below but to give a short overview of what it does:

1. Write x8000 to program mode 1

2. Write xFFFF for mode 1 to read all the channels

3. Write x2800 for entering mode 1

4. enter while loop with write all 0 since i dont need to change anything about that. 

below you can see the clock in blue and the MOSI in yellow with the x2800 write. As checked with the datasheet the MOSI is latched on the rising edge, so this should be correct right?

I can add screenshots of the cs line and MISO line too tomorrow. 

the HAL functions used in stm 32 cube ide for the first 3 transmitreceives are the following;

(the writepin is setting the cs line low and high)

after those the code enters the while loop of the microcontroller with a readfunction. 

I am clueless as to why its not working.

I continue to connect the ADS EVAL Board to its Motherboard to check if i broke the adc but it works fine so the mistake is somewhere else...

Thanks in advance

1 REPLY 1
Peter BENSCH
ST Employee

What do you expect from the command you have in several lines?

HAL_Delay(0.02);

HAL_Delay expects an uint32_t, i.e. an unsigned integer, so 0.02 will be reduced to 0.

Regards

/Peter

In order 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.