Need some help regarding___PIC16f877 or c8051f320

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 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 modify this code for 120khz frequency. How would I then make certain that it’s also only a burst of 1ms.

Thanks a lotJ

Replies

You are reading an archived discussion.

Related Posts

One of the most happening CEans here on CE celebrates his 23[sup]rd[/sup] birthday today. He is, CEan - Godfather! 😁 😁HaPpy Birthday, Godfather 😁 πŸŽ‰πŸŽ‰πŸŽ‰ May your dreams come true...
PS. This is a mail I received today πŸ˜€ Its really funny πŸ˜€ New Delhi. In what could prove to be a major marketing and legal embarrassment for Hindustan Unilever...
In its four-decade history, the Internet is set to undergo a biggest change with the expected approval this week that the international domain names or addresses can be written in...
The internet, the greatest aid to productivity in history, turns 40 this week. On October 29, (1969)πŸ˜›
The Department of Telecommunications (DoT) has directed all telecom service providers to implement an online centralized authentication procedure for Internet subscribers. According to DoT, all Internet and broadband subscribers using...