cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Driver for STM32 Nucleo L476RG using BARE METAL

MMoba.1
Associate

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.0693W000000VWEqQAO.jpg

CODE

0693W000000VWE7QAO.jpg 0693W000000VWEbQAO.jpg

1 REPLY 1
Kraal
Senior III

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.