Hi I am aashish, I am a pure beginner to 8051 microcontrollers and want to Blink a LED with it (as my first test).
But at the end the LED did not blin, LED glows continuously and dimmer.
I performed the following steps,
1. Generate Hex file from keil uVision
2. Flash the AT89S52 with this hex file using a 8051 programmer.
3. Connect a LED to AT89S52 on breadboard to test my work.
So where I was wrong? my program is incorrect/incomplete?? Or Does the AT89S52 not have an on chip clock? Whether I have to connect an external crystal?? Or anything I am missing….??
Please help me I am in a great need of it. Please help.
First off...you're schematic shows the port pin sourcing LED current. 8051 pins cannot source that kind of current. They can, however, sink it.
Connect the cathode end of the LED (i.e. the minus end - ) to pin P1.0. Then connect a resistor to the anode of the LED (i.e. the +) end. Connect the opposite end of the resistor to +5V.
Then, if you're coding in C, this function should do it -