help with input capture (68HC11)

Thread Starter

factorial555

Joined Apr 18, 2009
4
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;
}
 
Top