Hey guys!

I setup a breadboard circuit to do the basic single led blinking test using a AT89C52 chip. However, I do not get any blinking, it just lights up until power is stopped. I had only enabled a single bit for port0.0. The code is below. However, the led lights up even if I connect it to any other port. Is it a problem with my code? Please check it. Thank You.
[code]#include<reg52.h> sbit led = P0^0; void delay(int time) //This function produces a delay in msec. { int i,j; for(i=0;i<time;i++) for(j=0;j<1275;j++); } void main() { while(1) { led=0; delay(500); led=1; delay(500); } } [/code]


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir