This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

using TL0 and TL1

This is a cut down version of my program. This should gives the basic idea of what I'm doing which is counting pulses using (T0) and (T1) and comparing them to each other. The problem I'm having is that TL1 is not counting it acts like it timing.

#include <reg51.h>

void main (void)
{
int Board_a;
int Board_b;

TMOD = (TMOD & 0xF0) | 0x05;
TR0 = 1;
TR1 = 1;

while (1)
  {
	TL0 = 0;
	TL1 = 0;

	while (TL0 <= 100){}

	Board_a = TL0;
	Board_b = TL1;

	if (Board_a < Board_b)
		{//increase the voltage output to the firing board }

	if (Board_a > Board_b)
		{//decrease the voltage output to the firing board }
}

Thanks

0