Skip to main content
Le Phuong
Associate II
August 19, 2019
Question

Two ADC channel read while 7 channel are configured

  • August 19, 2019
  • 1 reply
  • 1889 views

0690X00000A9r6ZQAR.pngHI,

Im using stm32l4r5. i configured 7 channels of ADC1.And configured in regular conversion mode (7 ranks). Scan mode enable and continous disable. but when i debbug only two chanel transfer data to array and other element of array = 0 . any one help me resolve this problem 

This topic has been closed for replies.

1 reply

Ozone
Principal
August 19, 2019

> Im using stm32l4r5. i configured 7 channels of ADC1.And configured in regular conversion mode (7 ranks).

I suppose the problem is in the initialization code you did not present here.

When extending the number of ADC channels from 2 to 7, you need to update the accompanying DMA transfer size, too.

I don't do Cube, by the way.

Le Phuong
Le PhuongAuthor
Associate II
August 19, 2019

i chose word size for dma and uint32_t for variable

i fixed this problem when i reduce sample rate of adc. i dont know why and relate between dma clock and adc sample rate

Ozone
Principal
August 19, 2019

Without the accompanying init code, it is difficult to understand what you mean.

DMA is a quite "dumb" mechanism that transfers a number of memory objects from A to B, fired up with the configured trigger event (I assume EOS in this case), and giving a "done" interrupt (TC) when finished. This is at least the way I use it.