Skip to main content

Posts

Showing posts from August, 2010

Blogging: My Hobby

    Blogging is now a famous hobby in some people out there, not only on teenagers or on young ones but also to those young at once, because in blogging you will find new friends, it is somewhat like a social network. However, some did not find it a hobby, but a way to earn money online, to earn dollars, to gather advertisers, to become famous, etc. Nevertheless, do you still remember- when, what, where, why, whom, how did you find blogging first?     The first time I have heard about blogging was from my Environmental Science teacher in high school. It was 6:40 am in the morning, most of the arm chairs were vacant because it was so early that my other classmates were still in there bed. Our teacher told us to write or it is better to call it an easy, we must make an easy about our environment today and we must create our own blog. I ask my self, “What is a blog?” Right away, our teacher explained to us what blog, is really about. He said that blogging or making a blog, or a blog i

Interrupt in microcontroller

#include void ext0 () interrupt 0 {     P0=P0>>1;     if (P0==0)         P0=0x08; } void ext1 () interrupt 2 {     P0=P0<<1;     if (P0==0)         P0=0x10; } void main () {     char x;     P1=0x03;     P2=0x00;     P0=0x18;     EA=1;     EX0=1;     EX1=1;     IT1=1;     IT0=1;     while (1)     {         x=P1&0x03;         switch (x)         {             case 0:    P2=0x00;                     break;             case 1:    P2=0x03;                     break;             case 2:    P2=0x06;                     break;             case 3:    P2=0x07;                     break;         }     } }

Data Transmit with Hi

#include void main () {   char x;   P0=0x03;   P1=0x00;   TMOD=TMOD&0x0F;   TMOD=TMOD| 0x20;   TH1=0xFD;   TL1=0xFD;   SCON=0x50;   PCON=PCON|0x80;   TR1=1;   while (1)     {       x=P0&0x03;       switch (x)         {             case 0:                 P1=0x00;                 break;             case 1:                 TI=0;                 SBUF='H';                 while (TI==0);                 TI=0;                 SBUF='I';                 while (TI==0);                 TI=0;                 SBUF='!';                 while (TI==0);                 TI=0;                 SBUF= ' ';                 while (TI==0);                 break;             case 2:                 while (RI==0);                 P1=SBUF;                 RI=0;                 break;             case 3:                 P1=0xFF;         }     } }

C counter

#include void main () {     char xl,xh;     P0=0x00;     P1=0x00;     P2=0x00;     TMOD=TMOD&0xF0;     TMOD=TMOD|0x05;     TR0=1; while (1)  {   do    {     xh=TH0;     xl=TL0;    }    while (TH0!=xh);     P0=xl;     P1=xh; if ((TH0==0x01)&(TL0==0x90))   {   P2=0x01;   TR0=0;   TH0=0x00;   TL0=0x00;   TR0=1;   } else if ((TH0==0x00)&(TL0==0x01))  P2=0x00;  }  } }