Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/22/06 09:10
Read: times


 
#120840 - simple program to check the hardwar
Responding to: ???'s previous message
Finally i got my hands on SDCC
Now after learning this sufficiently i will try keil also
first one should try simple programs. So one can asure all things are allright.



/* Author Nikhil S Arora
ele.nikhil@gmail.com
program 1
Checking if condition
if port3.1 is high make p1=00 and if port3.1 is low then make p1=ff
and this goes on continuosly
*/
#include <at89x051.h>
void main(void)
{
while(1)
{
if(P3_1)
P1 =0x00;
else
P1 =0xff;
}

}

second program

#include <at89x051.h>
void main(void)
{
int i;
char j;

while(1)
{
P3 =0xff;
for(i=0;i<1000;i++)
{
for(j=0;j<100;j++)
{}
}
P3 =0x00;
for(i=0;i<1000;i++)
{
for(j=0;j<100;j++)
{}
}
}

}





List of 14 messages in thread
TopicAuthorDate
i want to learn sdcc and keil plz help            01/01/70 00:00      
   Example ?            01/01/70 00:00      
      need simple code to start with            01/01/70 00:00      
   what is in the manual            01/01/70 00:00      
      nice site            01/01/70 00:00      
         try mine            01/01/70 00:00      
   why not use e-mail            01/01/70 00:00      
   This is all there for you to see            01/01/70 00:00      
      simple program to check the hardwar            01/01/70 00:00      
   Timer program            01/01/70 00:00      
   interrupt program            01/01/70 00:00      
      how bloody awful            01/01/70 00:00      
   Serial program            01/01/70 00:00      
      How to post code            01/01/70 00:00      

Back to Subject List