2020-04-08 01:07 AM
I have written a code for STM32 L476RG for converting potentiometer analog output to digital output using ADC1. I am unable to understand SQR register use what should i pass to enable channel 6 of ADC1 in SQR register.Below are code and datasheet info.
CODE
2020-04-08 03:45 AM
Hi,
The L4 family (surely others too) can convert a sequence of ADC channels (regular and injected,but here let's concentrate on regular since it is what you need).
First is the L[3:0] which defines the number of convertions in the sequence (beware that 0 = 1).
Then you select which channels and which order you want. Writing SQR1 = 0x180 as you did convert the channel 6 only. So this is OK.
However there are other registers that needs to be configured in order to measure what you need with the ADC.
I encourage you to read the reference manual as everything is explained there.