free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Rickey's World :: Discussion Forums :: Discuss and Learn :: 8051 Discussion Forum
 
<< Previous thread | Next thread >>
LED is not blinking
Go to page       >>  
Moderators: Ajay Bhargav, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph, ExperimenterUK, DavesGarage
Author Post
Jatinder singh
Fri Jun 19 2009, 12:07PM
 User Offline
Registered Member #19500
Joined: Fri Jun 19 2009, 11:32AM

Posts: 24
Thanked 0 times in 0 posts
Hello to all,
I am beginner, i am using AT89c51 MCU. I was program the following program. Checked all the connection which i was found in the same forum (www.8051projects.net/forum-t10422.html), but LED did not blink. Program was compile with no error in SIDE51 sotware(demo) also used as making HEX file. Plz help me

#include <Atmel\AT89C51-AT89LV51.h>
void delay()
{ int i;
for(i=0;i<15000;i++)
}
void main(void)
{ while(1)
{ P1=0;
delay();
P1=1;
delay();
}
}

Back to top

Jatinder singh
Fri Jun 19 2009, 01:15PM
 User Offline
Registered Member #19500
Joined: Fri Jun 19 2009, 11:32AM

Posts: 24
Thanked 0 times in 0 posts
These are the connections
Back to top

ExperimenterUK
Fri Jun 19 2009, 02:48PM
 User Offline
Registered Member #9602
Joined: Tue Aug 05 2008, 04:15PM

Posts: 1268
Thanked 199 times in 198 posts
You may have to set port1 pins as outputs.
Look at samples of initializing code, that set pins on ports as outputs.
Back to top

rearthur2003
Sun Jun 21 2009, 02:39AM

 User Offline
Registered Member #10733
Joined: Thu Sep 18 2008, 11:54AM

Posts: 16
Thanked 0 times in 0 posts
Jatinder singh wrote ...

Hello to all,
I am beginner, i am using AT89c51 MCU. I was program the following program. Checked all the connection which i was found in the same forum (www.8051projects.net/forum-t10422.html), but LED did not blink. Program was compile with no error in SIDE51 sotware(demo) also used as making HEX file. Plz help me

#include <Atmel\AT89C51-AT89LV51.h>
void delay()
{ int i;
for(i=0;i<15000;i++)
}
void main(void)
{ while(1)
{ P1=0;
delay();
P1=1;
delay();
}
}


check the code i dont know of the software you are using but from the code i can say you have not define the port as output or input and try to specsify which bit to blink P1 is for the whole of port1
Back to top

shyam
Sun Jun 21 2009, 05:59AM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 847
Thanked 136 times in 125 posts
the compiler you are using is neither keil or sdcc compatible.
it is from SPJ systems (pune).

please use an example folder to check the hardware. u will find an led blink project in the SIDE-51 CD.



lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top

Jatinder singh
Sun Jun 21 2009, 09:33AM
 User Offline
Registered Member #19500
Joined: Fri Jun 19 2009, 11:32AM

Posts: 24
Thanked 0 times in 0 posts
Thanks, Now it is working.But second problem is happened , I am using universal adoptor(1.5V, 3V, 4.5V, 6V, 7.5, 9V) for power supply.When i switch on the power supply, LED does not blink(LED in continusely on). When i three four times on off on off the switch
LED start blinking. This happen always in same pattern. I am using Cap.10 uf 50V instead of Cap. 10 uf 25v.Where is the problem i cannot found.


[ Edited Sun Jun 21 2009, 09:48AM ]
Back to top

ExperimenterUK
Sun Jun 21 2009, 11:08AM
 User Offline
Registered Member #9602
Joined: Tue Aug 05 2008, 04:15PM

Posts: 1268
Thanked 199 times in 198 posts
You need a properly regulated supply.

Typically you feed the fairly crude output of your universal adapter into a
regulator such as a LM7805.

There are a few points to consider when making even a simple supply so it is
best that you do some research before trying again.
Back to top

Jatinder singh
Sun Jun 21 2009, 12:12PM
 User Offline
Registered Member #19500
Joined: Fri Jun 19 2009, 11:32AM

Posts: 24
Thanked 0 times in 0 posts
Thanks ExperimenterUK, I will try and tell you the results.
Back to top

Jatinder singh
Thu Jun 25 2009, 12:01PM
 User Offline
Registered Member #19500
Joined: Fri Jun 19 2009, 11:32AM

Posts: 24
Thanked 0 times in 0 posts
Hello ExperimenterUK/Shyam Sir,
Plz guide me where i am wrong.My program does not compile.



[ Edited Thu Jun 25 2009, 12:02PM ]
Back to top

ExperimenterUK
Thu Jun 25 2009, 03:22PM
 User Offline
Registered Member #9602
Joined: Tue Aug 05 2008, 04:15PM

Posts: 1268
Thanked 199 times in 198 posts
Is this example straight off the disc or have you changed something ?.

I'd guess it doesn't like
"sfr P1 = 0x90"

Have a look for similar declarations in example programs and copy them.
Back to top

Go to page       >>   

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems