cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Discovery with ADS7870 (TI) ADC

camila
Associate II
Posted on January 15, 2014 at 10:19

Hi,

I'm trying to communicate between the

http://www.ti.com/product/ADS7870

and the ST microcontroller STM32F4 Discovery evaluation board. I'm using IAR and at the moment I'm just trying to read register 31 from the ADC (which should return a 1) but with no luck.

I'm setting the SPI on the microcontrontroller as follows: data transmitted as MSB first, clock low in idle state, data is captured on rising edge, data size is 8 bits, and full duplex transmission.

In main.c I do:

http://e2e.ti.com/support/data_converters/precision_data_converters/f/73/t/3147aspx#

1

2

3

4

5

6

debug = ads7870Init();

if

(debug==1)

printf

(

''adc is alive \n''

);

else

printf

(

''adc is DEAD \n''

);

And in

http://www.ti.com/product/ads7870

_driver.c I have:

http://e2e.ti.com/support/data_converters/precision_data_converters/f/73/t/3147aspx#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

//initialize ADC

uint8_t ads7870Init(

void

)

{

//// check ID register

if

(ads7870ReadReg(ADS7870_ID) != ADS7870_ID_VALUE)

return

0;

else

{

//// setup reference and buffer

ads7870WriteReg(ADS7870_REFOSC, ADS7870_REFOSC_OSCE | ADS7870_REFOSC_REFE | ADS7870_REFOSC_BUFE);

//// return success

return

1;

}

}

I'm attaching a screenshot of what I see on the scope. (yellow: sclk, blue: read command register 31, purple: output from ADC).

http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/73/67stm32f4_5F00_response_5F00_scope.PNG

MOSI transmits properly to the

http://www.ti.com/product/ADS7870

(the din pin receives read command), but there is no response coming from the ADC dout pin.

I would really appreciate any help on this.

Thank you.

20 REPLIES 20
camila
Associate II
Posted on January 17, 2014 at 11:47

No, I will try that on Monday when I'm with the device. Thanks.