Skip to main content
Martin1
Associate II
Aug 14, 2018 2:57 PM UTC
Solved

How do I use ADC4 in MCSDK 5.X

Hello!

I would like to use the ADC4 of a nucleo303RE board with a X-NUCLEO-IHM08M1.

The Software (MCSDK 5.1.3) has functions already written for this in mc_tasks.c:

void MC_RequestRegularConv(uint8_t bChannel, uint8_t bSamplTime)

uint16_t MC_GetRegularConv(void)

UDRC_State_t MC_RegularConvState(void)

The Problem with this: I can only choose the Channel but not the ADC instance to be converted so the conversion is seemingly always made on ADC1. How can I change the ADCx (x=2,3,4) to be used for my conversion?

Many Thanks,

Martin

This topic has been closed for replies.
Claire O.
Claire O.Best answer
ST Employee
Aug 17, 2018 7:55 AM UTC

Dear Martin,

The purpose of these routines is to allow external access to resources that are already used by MC library in order to avoid concurrent accesses. (in that case ADC1 is used for temperature and bus voltage sensing). If you need a resource which is not used by MC library, please feel free to do so in your own application.

Best regards,

Claire

3 replies

Claire O.
Claire O.Best answer
ST Employee
Aug 17, 2018 7:55 AM UTC

Dear Martin,

The purpose of these routines is to allow external access to resources that are already used by MC library in order to avoid concurrent accesses. (in that case ADC1 is used for temperature and bus voltage sensing). If you need a resource which is not used by MC library, please feel free to do so in your own application.

Best regards,

Claire

Martin1
Martin1Author
Associate II
Aug 22, 2018 7:02 AM UTC

Nice! I thought I had to use those routines to not interfere with the rest of the software. Many thanks :)

Laurent Ca...
Senior III
Jun 28, 2021 5:32 AM UTC

The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK). 

Best regards