Moved from STM32F4 to M7, ADC library no longer works

General discussion on mikroC PRO for ARM.
Post Reply
Author
Message
cloudscapes
Posts: 35
Joined: 20 Dec 2009 06:24

Moved from STM32F4 to M7, ADC library no longer works

#1 Post by cloudscapes » 25 Apr 2020 21:54

Hi all,

Just moved from using a STM32F405 to STM32H753. Created a new project from scratch to be sure. New micro appears to work fine until I try to add ADC1_Init. Then it just doesn't execute code. It stays frozen.

This executes (led in while loop blinks):

Code: Select all

sbit LED1 at OD2_GPIOE_ODR_bit;

void main() {

     GPIO_Digital_Output(&GPIOE_BASE, _GPIO_PINMASK_2);    //led1

     GPIO_Analog_Input(&GPIOC_BASE, _GPIO_PINMASK_0);
     ADC_Set_Input_Channel(_ADC_CHANNEL_10);
     //ADC1_Init();

     Delay_ms(10);

     while(1) {
              LED1 = ~LED1;
              Delay_ms(100);
     }
}
This doesn't (no blinking led):

Code: Select all

sbit LED1 at OD2_GPIOE_ODR_bit;

void main() {

     GPIO_Digital_Output(&GPIOE_BASE, _GPIO_PINMASK_2);    //led1

     GPIO_Analog_Input(&GPIOC_BASE, _GPIO_PINMASK_0);
     ADC_Set_Input_Channel(_ADC_CHANNEL_10);
     ADC1_Init();

     Delay_ms(10);

     while(1) {
              LED1 = ~LED1;
              Delay_ms(100);
     }
}
All I did was init the ADC. In pretty much the same way I successfully did on the STM32F4. I see no distinction between F4 and H7 in the help documentation for the ADC library. I've tried ADC1, ADC2 and ADC3. Have also tried different channels. No change.

Anyone have an idea of what I'm doing wrong?

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: Moved from STM32F4 to M7, ADC library no longer works

#2 Post by jovana.medakovic » 27 Apr 2020 10:29

Hello,

Please, check if you set configuration bits correctly.
I recommend you look at this forum:
viewtopic.php?f=224&t=74695

Kind regards,
Jovana

cloudscapes
Posts: 35
Joined: 20 Dec 2009 06:24

Re: Moved from STM32F4 to M7, ADC library no longer works

#3 Post by cloudscapes » 27 Apr 2020 13:56

Hi Jovana, thanks for the reply!

It seems I have a similar issue to the original poster in the thread you linked to. Those same 9 settings are lost when I compile. And it looks like at least one of them has to do with the ADC clock (PLL2 DIVP).

Where can I find the corrected mlk file for STM32H753VI? Somehow I doubt using the corrected one for STM32H743ZI and renaming it will work. Since it's a different part.

Thanks.

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: Moved from STM32F4 to M7, ADC library no longer works

#4 Post by jovana.medakovic » 27 Apr 2020 14:30

Hello,

You can use the mlk file from that forum, just change the name of the file to STM32H753VI.mlk, and the name of the device at the file very beginning to STM32H753VI.

Kind regards,
Jovana

cloudscapes
Posts: 35
Joined: 20 Dec 2009 06:24

Re: Moved from STM32F4 to M7, ADC library no longer works

#5 Post by cloudscapes » 27 Apr 2020 17:52

Thanks, that seems to have fixed the ADC issue. At least in regards to init.

Post Reply

Return to “mikroC PRO for ARM General”