Hi Guys. I need some help with the following. I need to know how to generate a 1ms long burst of 120Khz square wave signal using P1_1,using the pic16f877 and the c8051f320 microcontroller by Silicon Labs. I was initially thinking of using the CCP modules to do this but I found an easier way on the internet:
void squarewave(void) //generates a square wave of 138kHz
unsigned int j;
for(j=0;j<0XFF;j++)
{
P1_1 =~ (P1_1); //Please explain this line of code to me???
}
P1_1 = 0;
}
But how do you know that the above wave would generate a square wave and especially that of a frequency of 138kHz. Please help me. How would I then make certain that it’s also only a burst of 1ms.
Thanks a lot
void squarewave(void) //generates a square wave of 138kHz
unsigned int j;
for(j=0;j<0XFF;j++)
{
P1_1 =~ (P1_1); //Please explain this line of code to me???
}
P1_1 = 0;
}
But how do you know that the above wave would generate a square wave and especially that of a frequency of 138kHz. Please help me. How would I then make certain that it’s also only a burst of 1ms.
Thanks a lot