Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

stm32 SPI Reading from AD7091R

Status
Not open for further replies.

kalix3

Newbie
Newbie level 1
Joined
Nov 15, 2021
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
Hello friends,
We used the CN-0336 reference design for our analog input module design. There is AD7091R 12-bit ADC on this design. I searched the documents of the relevant design and tried to read the design that we made specifically for the time diagrams in the given contents, on the STM32 f030 nucleo board, but I could not succeed. I would like to ask those who can provide information and help on this matter to get back to me. My variables are

uint8_t spi_buf[2]={0,0};
uint16_t adc_value;
uint8_t i;
float volt=0;
float testdata[60];


code and design specs here ;
 

Attachments

  • code.png
    code.png
    61.8 KB · Views: 156
  • spi.png
    spi.png
    98.8 KB · Views: 169

There are many approaches to this problem.
Possible quick fix: you need to enable interrupts for some peripherals to make them work under HAL libraries (you can find interrupt checkbox in pinout editor/spi parameters). I do not remember if this the case for SPI though.
See if there anything on SPI lines using scope, check if SPI related functions return HAL_OK, etc. I would recommend to debug SPI without AD7091R first. Configure second SPI port on STM32, or use additional nucleo board with SPI. Make it work, and then proceed with external SPI ADC.
 
Hi,

First you need to read the ADC datasheet acoording signals and timing.

Then you see that you need
* a falling edge of Convst
* Wait
* rising edge of convst
* wait
* falling edge of CS
* SPI transfer
* rising edge of CS
(For sure there are other approaches possible)

Then you nned to give a useful error description: "do not succeed" is not useful.

Klaus
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top