cancel
Showing results for 
Search instead for 
Did you mean: 

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

Kazuya_K
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
Khouloud ZEMMELI
ST Employee

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

View solution in original post

2 REPLIES 2
Khouloud ZEMMELI
ST Employee

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
Associate

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".