I'm making a system that gets the signal of a hall sensor attached to a fan, the faster it spins the faster is the signal, i want to use the interrupts on the RA to count the rising edge and calculate the RPM with the amount of rising edges in a specific time, what timer should i use? i'm trying to use the R_GPT but when i StatusGet it giver me a tipe of data i cant use with an if statement, how can i do it and what is the best timer for this?
Hello,
The above configuration has been verified to measure correctly external signal's frequency. If you still face any issue, you can send your project to check the code and FSP configuration.
Regards
RA2E1_Interrupt_test.rar
the problem with the code is that if i enable the interrupt on irq it interrupts the code while the fan is spining and giving signal, if i disable the irq the timer doenst show me any values to frequency, since the fan will be spining all the time it cannot stop the whole code while it spins, i was thinking of enabling the interrupt only for the timer period and them disabling it for each fan in an order
Can you please explain the project more?
I cannot understand why to disable the irq ( external interrupt irq or timer irq). If you do it, you will not be able to have speed feedback, in order to implement close loop control, unless if the motor is controlled by different mcu or is it is controlled sensorlessly and you just want to measure the speed using the speed sensor.