Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"No problem is so formidable that you can't walk away from it." -- C. Schulz


devel / comp.arch.embedded / Re: How to change stm32 m4 adc channel?

SubjectAuthor
o Re: How to change stm32 m4 adc channel?David Brown

1
Re: How to change stm32 m4 adc channel?

<s68eor$f6i$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=367&group=comp.arch.embedded#367

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: How to change stm32 m4 adc channel?
Date: Tue, 27 Apr 2021 09:33:46 +0200
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <s68eor$f6i$1@dont-email.me>
References: <7e069d6b-5918-4b8c-b093-6b28beeed223n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Apr 2021 07:33:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="eeb49757d68ac4236cc60a553138972f";
logging-data="15570"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pb5Mpwp+MyZl0Y2wwqfz4gUWgn6zE/60="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
Cancel-Lock: sha1:M73f4HcfA8joE949d6Oqq8d4pw4=
In-Reply-To: <7e069d6b-5918-4b8c-b093-6b28beeed223n@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Tue, 27 Apr 2021 07:33 UTC

On 26/04/2021 19:25, Ed Lee wrote:
> Does anyone know how to do it in register level?
>
> I see many code examples using:
>
> ADC_ChannelConfTypeDef sConfig = {ADC_CHANNEL_0, 1, ADC_SAMPLETIME_28CYCLES};
> HAL_ADC_ConfigChannel(&hadc1, &sConfig);
> or
> ADC_RegularChannelConfig(ADC1, ADC_channel_0, 1, ADC_SampleTime_480Cycles);
>
> but i don't have access to these routines from arm-gcc.
>

That last statement shows you perhaps don't have a full understanding of
what you are doing here.

However, the most likely cause of your troubles is that the examples you
have are using an SDK from ST, and you either don't have the SDK
installed and set up correctly, or you aren't using it in your project,
or you have simply forgotten to include the appropriate headers at the
start of your C file.

I have not used ST's tools myself, but I would expect that their SDK
comes with complete working example projects for some evaluation boards.
Start with one of these, and adapt it to suit your required changes.

> By the way, i am using this to read the adc data:
>
> #include "stm32f407xx.h"
> ADC1->CR2 |= ADC_CR2_SWSTART; // Start A2D
> while (!(ADC1->SR & ADC_SR_EOC)); // ready wait
> data = ADC1->DR;
>


devel / comp.arch.embedded / Re: How to change stm32 m4 adc channel?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor