- This topic has 8 replies, 5 voices, and was last updated 11 years, 7 months ago by .
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › Power supply problem for 8051
Hi,
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
what 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.
I use 11.0592 Mhz crystal with two 33pF
and leds are connected to thr correct ports
Sorry 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);
}
}
#
delay 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
Yes 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
I 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.
Hi HallBrooks,
You forgot to make the led port as output in your code!!
yes,check pin if it connection are correct,and in code verify the port 2 as output.