I'm trying to show an input capture on the terminal screen when I use a frequency generator. It's not showing and I don't know why. Here's the code:
#include <hc11.h>
#include <stdio.h>
main()
{
unsigned int edge1, frequency;
while(1)
{
TFLG1 = 0x04;
TCTL2 = 0x10;
while(!(TFLG1 & 0x04));
edge1 = TIC1;
TFLG1 = 0x04;
while(!(TFLG1 & 0x04));
frequency = (1 /(TIC1 - edge1));
printf("\nThe frequency of the signal is %u E clock cycles. \n",frequency);
}
return 0;
}
#include <hc11.h>
#include <stdio.h>
main()
{
unsigned int edge1, frequency;
while(1)
{
TFLG1 = 0x04;
TCTL2 = 0x10;
while(!(TFLG1 & 0x04));
edge1 = TIC1;
TFLG1 = 0x04;
while(!(TFLG1 & 0x04));
frequency = (1 /(TIC1 - edge1));
printf("\nThe frequency of the signal is %u E clock cycles. \n",frequency);
}
return 0;
}