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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/30/02 07:39
Read: times


 
#23632 - 8051 inputs outputs problem
hello there

very basic problem how to output some a signal to the output pin. i run the program.


main()
{

while(1)
P1 = 255;

}

it runs and LED was off as LED negative was connected to 8051 pin and posititve to +5 with resistor.


main()
{

while(1)
P1 = 0;

}

again run the progrem with LED on.



now problem starts when i try to run this program





main()
{

unsigned int a;


while(1)
{
P1 = 0;
for(a=0;a<10000;a++)
wait();

P1 = 255;
for(a=0;a<10000;a++)
wait();


}}


wait()
{
;
}



LED is connected to one of the output port 1 pin.

i was expecting a blinking LED it does not happen.


what's the problem. i was trying to control the LCD when this problem comes and i got realize that i am got generating the siganls properly and then i try to run this simple program and was amazed that i can not properly blink a single LED except for just on or off LED. i think i am comfortable with inputting a single i hope this will not bother me when i design a keyboard. any suggestion in that.

also i need a piece of code which generate a specified dely for example 10ms or 20ms or 1s.


Shahzad

List of 7 messages in thread
TopicAuthorDate
8051 inputs outputs problem            01/01/70 00:00      
RE: 8051 inputs outputs problem            01/01/70 00:00      
RE: 8051 inputs outputs problem            01/01/70 00:00      
RE: 8051 inputs outputs problem            01/01/70 00:00      
RE: 8051 inputs outputs problem            01/01/70 00:00      
RE: 8051 inputs outputs problem            01/01/70 00:00      
RE: 8051 inputs outputs problem            01/01/70 00:00      

Back to Subject List