Hello everyone! I have to connect an inductive sensor to my STM32F769I-DISCO in order to count rising edges of an external signal. So, especially if you have already done that, I would need some advice about the inputs of my microcontroller I may use to carry out the connection with the inductive sensor.
By the way, to count rising edges, I am wondering which functions I could use. Otherwise, do you know a specific method for doing that?
I truly thank you in advance for your help (I'm still a newcomer in that field to be honest).
Sincerely,
Pulse counter (external signal) with a STM32F769I-DISCO board
Re: Pulse counter (external signal) with a STM32F769I-DISCO board
Just use interrupt.
eg:
Depending on your circuit and sensor, you might need to use pull down or pull up resistor on input pin.
eg:
Code: Select all
volatile uint32_t impulseCount=0;
void ISR(){
impulseCount++;
}
void setup() {
// put your setup code here, to run once:
pinMode(<pin>,INPUT);
attachInterrupt(<pin>,ISR,RISING);
}
-
- Posts: 3
- Joined: Thu Mar 24, 2022 7:15 pm
- Location: Greece
Re: Pulse counter (external signal) with a STM32F769I-DISCO board
@GonzoG which pins can I use for external interrupt?
Thank you!
Thank you!
Re: Pulse counter (external signal) with a STM32F769I-DISCO board
I think that STM32s can use any pin as an external interrupt.