Skip to main content
Kazuya_K
Associate
January 7, 2021
Solved

STM32G031J6M6 ADC Channel 15 to 18 cannot select in the latest version of the CubeMX.

  • January 7, 2021
  • 2 replies
  • 2275 views

Hello, I'm using the STM32G031J6M6 8-pin Cortex-M0+ chip.

I'm trying to use the ADC channel 16 however, I cannot select the channel.

I confirmed which channel can select that I can select channel 0 to 11.

Channel 11, 15 to 18 cannot select in the latest version of the Cube MX.

If I use channel 11, 15 to 18, do I need something operation?

Do you have any solutions? 

Thank you for watching.​

0693W000006HsD7QAK.png

This topic has been closed for replies.
Best answer by Khouloud ZEMMELI

Hi @Kazuya_K​ 

It's a normal behavior, if fact, when sequencer is set to "not fully configurable" the CHSELRMOD = 0 in ADC_CFGR1, so ADC_CHSELR is up to 19 channels (CHSEL 0 to CHSEL 18). In your case, when sequencer is set to "fully configurable" the CHSELRMOD = 1 in ADC_CFGR1, so ADC_CHSELR is able to sequence up to only 8 channels (CH 0 to CH 14)

The Rank configuration can be done only in the "fully configurable" sequencer case, for that, you cannot choose Channel 16 under Rank.

Hope that my answer helped you, Khouloud

2 replies

Khouloud ZEMMELI
Khouloud ZEMMELIBest answer
ST Employee
January 7, 2021

Hi @Kazuya_K​ 

It's a normal behavior, if fact, when sequencer is set to "not fully configurable" the CHSELRMOD = 0 in ADC_CFGR1, so ADC_CHSELR is up to 19 channels (CHSEL 0 to CHSEL 18). In your case, when sequencer is set to "fully configurable" the CHSELRMOD = 1 in ADC_CFGR1, so ADC_CHSELR is able to sequence up to only 8 channels (CH 0 to CH 14)

The Rank configuration can be done only in the "fully configurable" sequencer case, for that, you cannot choose Channel 16 under Rank.

Hope that my answer helped you, Khouloud

Kazuya_K
Kazuya_KAuthor
Associate
January 7, 2021

Thank you for your kindly help!

I can select channel 16 using the Cube MX and read the analog value from the channel.

For anyone who has the same problem as me, you can see the description of the "not fully configurable or fully configurable" in the reference manual RM0444 (Rev 5) "14.3.8 Channel selection".