cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use ADC4 in MCSDK 5.X

Martin1
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Claire O.
ST Employee

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

View solution in original post

3 REPLIES 3
Claire O.
ST Employee

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
Associate III

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

Laurent Ca...
Lead II

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