Microcontroller › 8051 › Power supply problem for 8051
- This topic has 8 replies, 5 voices, and was last updated 12 years, 10 months ago by
santhosh kumar.
-
AuthorPosts
-
May 30, 2013 at 5:29 pm #2455
HallBrooks
ParticipantHi,
i want to try my first and simple code for blinking led which is working well in simulation with Proteus and a 8051 developpeent board.
I reproduce the same power supply of the kit with a pcb board and when i try my program, the led glow but not blinking.
So the prower supply in my Kit is 5.00V
I measured the output of the led which is in P2.0 i have 4.85V , the voltage is always high.
with my pcb board the power supply is 4.85V
and i used the same crystal (11.0592hz) with two 33pF
So why my led did not blink, some when switch on the board nothing happen and some all ouptut are high.
what is the problem here?
Thank you
May 31, 2013 at 7:15 am #9869rameshwar shivaji kumbhar
Participantwhat time delay you have given
also check leds are connected to proper pins of the port as mentioned in the program.
if possible upload program.
May 31, 2013 at 7:02 pm #9873HallBrooks
ParticipantI use 11.0592 Mhz crystal with two 33pF
and leds are connected to thr correct ports
May 31, 2013 at 7:04 pm #9874HallBrooks
ParticipantSorry if forgot the time delay but here is the code:
#include <reg52.h>
#define ON 0
#define OFF 1
sbit LED = P2^0;
void DelayMs(unsigned int msec);
void DelayMs(unsigned int msec)
{
unsigned int x,y;
for(x=0; x<=msec;x++)
{
for(y=0;y<=210;y++);
}
}
void main(void)
{
for(;
{
LED = ON;
DelayMs(100);
LED = OFF;
DelayMs(100);
}
}#
June 1, 2013 at 11:53 am #9876vishal chavan
Participantdelay of 100ms is too small ,try to increse it atleast 1000ms to get delay of 1sec between on and off. if then also it doesnt worh try to reflash your program
June 1, 2013 at 5:35 pm #9877HallBrooks
ParticipantYes for 1000ms delay, the Led glow for a 0.5s and then stay off always.
I tried 500ms delay, the Led stay high always.
please have a look with this design, i reproduced this in a bread board with +5V at pin (40) and ground to pin (20).
the test is always not working for me.
thank you
June 1, 2013 at 6:29 pm #9878HallBrooks
ParticipantI still don’t understand my problem.
the same code is working with a developpement board (8051) but not working in a breadboard or a pcb.
it’s working very in Proteus too.
I want my small project of robot line follower, hte code is working fine in proteus and the developpement board, i can’t use a big developpement board in my tiny robot.
June 29, 2013 at 5:48 am #10054AJISH ALFRED
ParticipantHi HallBrooks,
You forgot to make the led port as output in your code!!
June 29, 2013 at 3:44 pm #10063santhosh kumar
Participantyes,check pin if it connection are correct,and in code verify the port 2 as output.
-
AuthorPosts
- You must be logged in to reply to this topic.