stm32l031k6 and Comparator Setup and interrupt

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
RadaR
Posts: 19
Joined: Tue Sep 17, 2019 11:34 pm
Has thanked: 1 time

stm32l031k6 and Comparator Setup and interrupt

Post by RadaR »

Thanks for your great project.

I am newbie in ChibiOS. I my project i need to use a Comparator 1 and Comparator2 (stm32l031k6, need to setup and configure Comparators and in interupt code - perform time critical code ).

Can somebody help or give link to comparator's sample in ChibiOS?

Really need community help.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: stm32l031k6 and Comparator Setup and interrupt

Post by Giovanni »

Hi,

In ChibiOS there is no direct support for comparators, if you find generic code then it could be integrated with some effort, there we could help.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: stm32l031k6 and Comparator Setup and interrupt

Post by Giovanni »

I forgot about that, you can give it a try. It is into the ./community directory in ChibiOS.

Note that code in ./community is contributed and not necessarily maintained, you may need to make adjustments.

Giovanni
RadaR
Posts: 19
Joined: Tue Sep 17, 2019 11:34 pm
Has thanked: 1 time

Re: stm32l031k6 and Comparator Setup and interrupt

Post by RadaR »

Hi, i need a help of ChibiOS's Contrib community.

I am newbie in ChibiOS architectory. So faced with promblem when adopting COMPv1 to stm32L031 (M0).

In stm32l031 (Mo) Comparator uses interrupt - ADC1_COMP_IRQHandler same that a ADC.

But in COMPv1 - STM32_COMP_1_2_3_IRQ_PRIORITY (COMP_1) and and STM32_COMP_1_2_3_IRQ_PRIORITY (COMP_2).

As i understand ChibiOS HAL use ADC1_COMP_IRQHandler for ADC HAL Driver? Or i can change library to use ADC1_COMP_IRQHandler?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: stm32l031k6 and Comparator Setup and interrupt

Post by Giovanni »

Hi,

The ADC handler should not be used on the L0, you should be able to use it for the comparator.

Giovanni
RadaR
Posts: 19
Joined: Tue Sep 17, 2019 11:34 pm
Has thanked: 1 time

Re: stm32l031k6 and Comparator Setup and interrupt

Post by RadaR »

Thanks
Post Reply