STM32F4 with external simultaneous ADC - Page 1
Forum section: electronics / general

author: rheb1026
author_rank: Regular Contributor
timestamp: February 07, 2017, 05:43:13 pm
content: I was looking to use a simultaneous sampling ADC in my software radio receiver to digitize the I and Q streams and was looking for some guidance. I was looking to use something like the AD7902 which uses two standard SPI blocks - one for each converter. Obviously I can just read from each one individually, but the datasheet shows each of the clock, input, and conversion lines tied together with the two data output lines independent which got me thinking... Is there an easy way to use a single SPI in the STM32, but use a dual input of the two data lines? I looked at the QSPI peripheral, but there doesn't appear to be an obvious way to do this. They only seem to be set up for accessing memory

author: langwadt
author_rank: Super Contributor
timestamp: February 07, 2017, 06:47:23 pm
content: Quote from: rheb1026 on February 07, 2017, 05:43:13 pmwhy not daisy chain them? (fig.46 in the datasheet)

author: rheb1026
author_rank: Regular Contributor
timestamp: February 07, 2017, 07:18:40 pm
content: You're right I could do this, and it might end up being the easiest way to go. I guess I was hoping that there would be a way to get the data out of both converters on the CLK stream for only one - reading both 16-bit data registers using only 16 clocks

author: Scrts
author_rank: Frequent Contributor
timestamp: February 08, 2017, 03:54:08 am
content: I'd use two SPI peripherals with DMA then.

author: bobaruni
author_rank: Regular Contributor
timestamp: February 08, 2017, 06:56:48 am
content: Take a look at TI's ADS8363http://www.ti.com/product/ADS8363, I think you might be able to do it with a single SPI peripheral.You also have the bonus of built in oversampling (this may or may not be useful on an I/Q SDR) and also a mux on each ADC to let you choose different frequency bands.I'm about to test an ADS8363 with an STM32F373 (cortex M4F) in the next few days.

author: ajb
author_rank: Super Contributor
timestamp: April 07, 2017, 01:59:53 pm
content: Quote from: rheb1026 on February 07, 2017, 05:43:13 pmI'm just working with the QUADSPI in an STM32F7 and remembered this thread. You can definitely use the QUADSPI for non-memory applications in "indirect" mode. Individual transactions are setup in the QUADSPI->CCR register, which defines transaction mode, instruction format (if any), data format (if any), address format (if any), and alternate byte format (if any). Of course, in a case like yours the data from the two ADCs winds up interleaved and will need to be separated later on, because in all modes the QUADSPI only transfers one stream of data regardless of the number of data lines used.If the ADCs don't require any instructions to be issued, and you just need to yank the data out of them, the below should be all you need. Writing to CCR.INSTRUCTION is sufficient to start a transaction in indirect mode if no address is being issued. If you don't need to issue an address, instruction, or alternate bytes most of CCR can be kept at 0 and you only need to configure the mode and the data format.Code:// initializationQUADSPI->CR = QUADSPI_CR_FSEL; //if using bank 2, otherwise leave outuint32_t div = ( AHB_CLK_FREQ / QUADSPI_CLK_FREQ ) - 1;QSPI->CR = (div << QUADSPI_CR_PRESCALER_gp);QUADSPI->DCR = ( 7<< QUADSPI_DCR_CSHT_gp); // 7 -> 8 clock cycles of nCS high between transactionsQUADSPI->CR |= QUADSPI_CR_EN;// start a transactionQUADSPI->DLR = 3; //number of bytes to receive - 1QUADSPI->CCR =QUADSPI_CCR_FMODE_INDREAD |QUADSPI_CCR_DMODE_DUAL; //data will be received on IO0 and IO1//wait for transaction to be finishedwhile( !(QUADSPI->SR & QUADSPI_SR_TCF));QUADSPI->FCR = QUADSPI_FCR_CTCF; //Transfer Complete flag must be cleared manually//read data out of 32-byte FIFO via QUADSPI->DRIn indirect mode, DMA treats QUADSPI as a peripheral (versus as memory location in memory mapped mode), and you can trigger DMA transfers based on the QUADSPI FIFO level. You should be able to use one DMA channel to write to QUADSPI->CR to trigger a read from the ADC and then use a second DMA channel to read out from the FIFO for fully-automatic continuous reads.Hope that helps.

author: rheb1026
author_rank: Regular Contributor
timestamp: April 14, 2017, 12:28:31 pm
content: Thanks for the info! I'll definitely look into this!

author: danadak
author_rank: Super Contributor
timestamp: April 14, 2017, 09:24:54 pm
content: Or use a PSOC with dual 12 bit SAR and a ton of other stuff (includingDSP engine). See attached.Regards, Dana.

author: rheb1026
author_rank: Regular Contributor
timestamp: April 17, 2017, 04:07:24 am
content: The PSOC is on the list of things I want to learn!

author: qmmdzd
author_rank: Newbie
timestamp: October 31, 2017, 01:23:24 am
content: ??STM32??ADS8363?957673760@qq.com

author: danadak
author_rank: Super Contributor
timestamp: November 01, 2017, 11:43:28 am
content: Some additional info -1) Routability2) Fast 12 bit SAR A/D and slow 20 bit DelSig3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFBcan be used as a GP fast processor block, similar to RISC block4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGAlike capability5) Onboard Vref6) IDAC, VDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....7) LCD, COM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE, USB9) Custom components capability, create with schematic capture or Verilog10) DMA to offload processes like filters, COM, Display11) ARM M0 (PSOC 4) or M3 (PSOC 5LP) or 8051 core(PSOC 3) or M0+/M4 dual core PSOC 612) Extensive clock generation capabilities13) All components supported by extensive prewritten APIshttps://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=truehttp://www.cypress.com/documentation/code-examples/psoc-345-code-examplesGreat video libraryAttached component list. A component is an on chip HW resource.Free GUI design tool with schematic capture, "Creator". Components have rich API library attachedto each component. Compilers free as well.PSOC 4 is low end of family, consider 5LP parts as well. PSOC 4 also has arduino footprint boards (pioneer) as well. PSOC 6 dual core M0+/M4.https://www.elektormagazine.com/labs/robot-build-with-cypress-psochttp://www.cypress.com/products/32-bit-arm-cortex-m-psochttps://brightcove.hs.llnwd.net/e1/uds/pd/1362235890001/1362235890001_5241352463001_2606504288001.mp4?pubId=1362235890001&videoId=2606504288001Regards, Dana.