How can use the interrupts with Stm32 BluePill

Hi

How can use the interrupts with Stm32 BluePill ?

Which library must use?

You don't need a library to use interrupts with the STM32F1. There probably isn't one. As far as I know, generic interrupts (such as pin interrupts) are not expressed any differently with an STM than with an AVR.

If you provide more information, such as which interrupts you want to use, you will get better answers here.

I want use analoge external interrupt.
can you help me how do this?

Errr.... What's an analogue interrupt?

I want use interrupt because I want calculate frequency for analogue signal,So I saied analogue interrupt. ;D
Can you help me ?

JAMAL_Abdullah:
I want use interrupt because I want calculate frequency for analogue signal,So I said analogue interrupt. ;D
Can you help me ?

You can't get an interrupt from an analogue signal. When would it interrupt?

At the very least you need to feed the analogue signal into a comparator, which will generate a digital signal, which can then generate an interrupt.

Some microprocessors have comparators built in.
Does the STM32F1? Sorry, I don't know.

In order for anyone to help you they first have to understand your requirements. Perhaps you should explain a little more about what analogue signal you are trying to measure the frequency of, and most importantly how you are connecting it to the STM32F1.

thank you for your replay.
I will use comparator.
so can you tell me how use interrupt ?and what is library name to do interrupt ?

JAMAL_Abdullah:
I will use comparator.

An external comparator, or does the STM32F1 have an internal comparator?

If it's an external comparator, which pin is it connected to?
If it's the internal one, do you even know how to use it?

internal comparator,but I don't know use :frowning: .
Can you tell me please?

Can you point me at the comparator in the STM32F103 datasheet please?

Here's a tutorial on the digital interrupts.

I thought you knew there was a comparator in the STM32F103.
I alse searched a comparator in the STM32F103 datasheet please but I not found ,so I will use external interrupt .

thank you so much for your help me. :slight_smile:

finally question please :slight_smile:
Can you gave me example about how can use internal interrupt?
because I want implementation of specific code inside function interrupt.

I thought you knew there was a comparator in the STM32F103.

I'm not sure I could have been much clearer....

Does the STM32F1? Sorry, I don't know.

An external comparator, or does the STM32F1 have an internal comparator?

No, I couldn't find a reference to one either. That's why I asked you to show me, because...

I will use comparator.
internal comparator,but I don't know use

It's almost as if you are not reading my replies...

Here's a tutorial on the digital interrupts.

So we agree. That microprocessor does not have one. So you will need an external comparator connected to an external interrupt pin. Have you decided on a pin yet?

You want to use an internal interrupt now? Hopefully that is a typo, because an internal interrupt will not help you with an external comparator.

A sample for an external interrupts is clearly shown in the linked tutorial specifically for the STM32F1 device. As aarg said earlier, the code and syntax it's entirely the same as with any AVR.