2020-09-01 02:56 AM
can anyone help me how to code please . Actually this my first project.
thank you
2020-09-01 06:58 AM
A 100 kHz interrupt is a bit fast. You might starve the CPU of resources.
Counting edges can be done with the timers.
One place to start is with HAL examples.
2020-09-01 08:53 PM
i am already generating two waveforms with some dealy . But should i use Input capture method to capture the values at rising edge at each pulse and need to count for every rising edge using interrupt.
i am going to set my flag as start counter=1;
if(start counter==1) // if my flag is equal to 1 going to start the counter at each rising edge
{
do
{
uint16_t count = __HAL_GET_COUNTER(&htimx); // these lines of code do i need to add in my IC calling function or in while loop
count++;
}while(start counter!=0) // if my flag is equal to 0 reset my counter
count =0; // i need to reset my counter
}
should i need to to measure input capture value of both rising edges also because i need to calculate the phase angle between two waveforms. If so were i need to add my code to measure input capture values. if my code has any mistake can you please suggest me i am confused of it.
Thank you