Showing posts with label 8051 Microcontroller. Show all posts
Showing posts with label 8051 Microcontroller. Show all posts

Direct Memory Access

By With No comments:
Direct memory access (DMA) is a technique for transferring blocks of data directly between two hardware devices. In the absence of DMA, the processor must read the data from one device and write it to the other, one byte or word at a time. If the amount of data to be transferred is large, or the frequency of transfers is high, the rest of the software might never get a chance to run. However, if a DMA controller is present it is possible to have it perform the entire transfer, with little assistance from the processor. 


Here's how DMA works. When a block of data needs to be transferred, the processor provides the DMA controller with the source and destination addresses and the total number of bytes. The DMA controller then transfers the data from the source to the destination automatically. After each byte is copied, each address is incremented and the number of bytes remaining is reduced by one. When the number of bytes remaining reaches zero, the block transfer ends and the DMA controller sends an interrupt to the processor. 


In a typical DMA scenario, the block of data is transferred directly to or from memory. For example, a network controller might want to place an incoming network packet into memory as it arrives, but only notify the processor once the entire packet has been received. By using DMA, the processor can spend more time processing the data once it arrives and less time transferring it between devices. The processor and DMA controller must share the address and data buses during this time, but this is handled automatically by the hardware and the processor is otherwise uninvolved with the actual transfer

What is Cross compiler?

By With No comments:
An embedded systems developer writes and compiles programs on a larger computer which can support a C development environment. The compiler used does not translate to the machine language of the development computer, it produces a version of the program in the machine language of the 8 bit microcontroller. A compiler that runs on one type of computer and provides a translation for a different type of computer is called a cross-platform compiler or cross-compiler.


The object code formats generated by a cross-compiler are based on the target device. For example, a compiler for the Motorola MC68HC705C8 could generate an S-record file for its object code.

What is Simulator?

By With No comments:
A simulator is a software program which allows a developer to run a program designed for one type of machine (the target machine) on another (the development machine). The simulator simulates the running conditions of the target machine on the development machine. Using a simulator you can step through your code while the program is running.


You can change parts of your code in order to experiment with different solutions to a programming problem. Simulators do not support real interrupts or devices. An in-circuit simulator includes a hardware device which can be connected to your development system to behave like the target microcontroller. The incircuit simulator has all the functionality of the software simulator while also supporting the emulation of the microcontroller’s I/O capabilities.

What is The Linker?

By With No comments:
When programs were written in the past often the development computer was not powerful enough to hold the entire program being developed in memory at one time. Historically, programs had to be divided into separate modules where each module would be compiled into object code and a linker would link the object modules together. Our development machines today are very powerful and the use of a linker is no longer absolutely necessary.




Many implementations of C provide function libraries which have been precompiled for a particular computer. These functions serve common program needs such as serial port support, input/output, and description of the destination computer. Functions within libraries are usually either linked with modules which use them or included directly by the compiler if the compiler supports library function inclusion.

When your program has been pre-processed, compiled and linked, the destination computer will be able to read and execute your program.

What is The Compiler?

By With No comments:
The compiler translates a program into an intermediate form containing both machine code and information about the program’s contents. The compiler is the second component to handle your program. The compiler has the most important job: digesting and translating the program into a language readable by the destination computer.


Many compilers operate in different passes through the code. There are often passes specifically to handle optimizations of code which will reduce the size of the machine code generated.

What are the Buses in Microcontroller?

By With No comments:
A bus carries information in the form of signals. There are three main buses: address, data, and control.


1) The address bus is unidirectional and carries the addresses of memory locations indicating where the data is stored. The number of wires in the address bus determines the total number of memory locations. With a 13 bit address bus, for example, there would be 213 or 8192 memory locations.


2) The data bus is bi-directional and carries information between the CPU and memory or I/O devices. Computers are often classified according to the size of their data bus. The term “8-bit microcontroller” refers to a microcontroller with 8 lines on its data bus. The number of wires in the data bus determines the number of bits that can be stored in each memory location.


3) The control bus carries data which controls system activity. Often this data includes timing signals which synchronize the movement of other information.

Harvard Architecture of Microcontroller

By With No comments:
Harvard architecture computers have separate memory areas for program instructions and data. There are two or more internal data buses which allow simultaneous access to both instructions and data. The CPU fetches instructions on the program memory bus. If the fetched instruction requires an operation on data memory, the CPU can fetch the next program instruction while it uses the data bus for its data operation. This speeds up execution time at the cost of more hardware complexity.

Since Harvard machines assume that only instructions are stored in program memory space, how do you write and access data stored in program memory space? For example, a data value declared as a C constant must be stored in ROM as a constant value. Different microcontrollers have different solutions to this problem. A good C compiler automatically generates the code to suit the target hardware’s requirements. Some chips have special instructions allowing the retrieval of information from program memory space. These instructions are always more complex or expensive than the equivalent instructions for fetching data from data memory.


Typically these chips have a register analogous to the program counter (PC) which refers to addresses in program space. Also, some chips support the use of any 16 bit value contained in data space as a pointer into the program address space. These chips have special instructions to use these data pointers.

NOTE

It is important that you understand how your Harvard architecture part deals with data in program space. It is possible to generate more efficient code using symbolic constants declared with #define directives instead of declared constants. You may also create global variables for constant values.

Von Neumann Architecture of Microcontroller

By With No comments:
Von Neumann architecture has a single, common memory space where both program instructions and data are stored. There is a single data bus which fetches both instructions and data. Each time the CPU fetches a program instruction it may have to perform one or more read/write operations to data memory space. It must wait until these subsequent operations are complete before it can fetch and decode the next program instruction. The advantage to this architecture lies in its simplicity and economy.


NOTE

On some Von Neumann machines the program can read from and write to CPU registers, including the program counter. This can be dangerous as you can point the PC at memory blocks outside program memory space. Careless PC manipulation can cause errors which require a hard reset.

What are the Registers in microcontroller?

By With No comments:
Registers store the state of the CPU. If the contents of microcontroller memory and the contents of these registers are saved it is possible to suspend program operation for an indefinite period of time and restart exactly in the state when the program was suspended.

The number and names of registers varies drastically among microcontrollers. However there are certain registers which are common to most microcontrollers, although the names may vary. These include:
"# The stack pointer

The stack pointer contains the address of the next location on the stack.The address in the stack pointer is decremented when data is pushed on the stack and incremented when data is popped from the stack.


"# The index register
The index register is used to specify an address when certain addressing modes are used. It is also known as the pointer register. The Microchip devices use the name FSR (file select register).

"# The program counter
Perhaps the single most important CPU register is the program counter (PC). The PC holds the address of the next instruction in program memory space. It contains the address of the next instruction the CPU will process.
As each instruction is fetched and processed by the ALU, the CPU increments the PC and thereby steps through the program stored in the program memory space.

"# The accumulator
The accumulator is a register that can hold operands or results of operations as necessary. The Microchip devices use the name W (working) register.

Other registers may reflect results from the instruction just executed, control the options available on the device, and enable access to certain areas of memory.

The Microcontroller in a System

By With No comments:
Microcontrollers do not function in isolation. As their name suggests they are designed to control other devices. The microcontroller can accept inputs from some devices and provide outputs to other devices within any given system. For example, a microcontroller may accept input from a switch and may send output to an LED. If the switch is pressed the microcontroller can be instructed to illuminate the LED.


The microcontroller is often part of a larger system. For example, the switch and LED may be part of a compact disc player in a car stereo system. When a microcontroller is part of a larger system it is often referred to as an embedded controller because it is embedded within the larger system.

What is RAM?

By With No comments:
RAM, random access memory, is used to write and read data values as a program runs. RAM is volatile: if you remove the power supply its contents are lost. Any variables used in a program are allocated from RAM. The time to retrieve information from RAM does not depend upon the location of the information because RAM is not sequential, hence the term random access.


Most small microcontrollers provide very little RAM which forces you to write applications that use RAM wisely. Manipulating large data structures and using pointers, re-entrant or recursive functions use large amounts of RAM and are techniques which are generally avoided on microcontrollers.


Some C instructions which are rarely used on larger platforms are more commonly used in C programs for microcontrollers. One example is the goto instruction reviled by traditional C programmers. While goto is rarely used on larger platforms, in embedded system programming it can sometimes be used to save RAM.

What is ROM?

By With No comments:
ROM, read only memory, is non-volatile memory used for program information and permanent data. The microcontroller uses ROM memory space to store program instructions it will execute when it is started or reset.


Program instructions must be saved in non-volatile memory so that they are not affected by loss of power. The microcontroller usually cannot write data to program memory space.

What is a Microcontroller?

By With No comments:
A microcontroller is a single chip, self-contained computer which incorporates all the basic components of a personal computer on a much smaller scale.
Microcontrollers are often referred to as single chip devices or single chip computers. The main consequence of the microcontroller’s small size is that its resources are far more limited than those of a desktop personal computer.

In functional terms, a microcontroller is a programmable single chip which controls a process or system. Microcontrollers are typically used as embedded controllers where they control part of a larger system such as an appliance, automobile, scientific instrument or a computer peripheral. Microcontrollers are designed to be low cost solutions; therefore using them can drastically reduces part and design costs for a project.

Physically, a microcontroller is an integrated circuit with pins along each side. The pins presented by a microcontroller are used for power, ground, oscillator,I/O ports, interrupt request signals, reset and control. In contrast, the pins exposed by a microprocessor are most often memory bus signals (rather than I/O ports).

NOTE

A microcontroller is not the same as a microprocessor. A microprocessor is a single chip CPU used within other computer systems. A microcontroller is itself a single chip computer system

Why the clock frequency of embedded system should be as low as possible?

By With No comments:
Many developers select an oscillator / resonator frequency that is at or near the maximum value supported by a particular device.

This can be a mistake:

• Many application do not require the levels of performance that a modern 8051 device can provide.

• The electromagnetic interference (EMI) generated by a circuit increases with clock frequency.

• In most modern (CMOS-based) 8051s, there is an almost linear relationship between the oscillator frequency and the power-supply current. As a result, by using the lowest frequency necessary it is possible to reduce the power requirement: this can be useful in many applications.


• When accessing low-speed peripherals (such as slow memory, or LCD displays), programming and hardware design can be greatly simplified - and the cost of peripheral components, such as memory latches, can be reduced - if the chip is operating more slowly

In general, you should operate at the lowest possible oscillator frequency compatible with the performance needs of your application.

Why we use C programming for embedded systems?

By With No comments:
It is a ‘mid-level’, with ‘high-level’ features (such as support for functions and modules), and ‘low-level’ features (such as good access to hardware via pointers);

• It is very efficient;

• It is popular and well understood;

• Even desktop developers who have used only Java or C++ can soon understand C syntax;

• Good, well-proven compilers are available for every embedded processor (8-bit to 32-bit or more);

• Experienced staff are available;

Books, training courses, code samples and WWW sites discussing the use of the language are all widely available.


Overall, C may not be a perfect language for developing embedded systems, but it is a good choice (and is unlikely that a ‘perfect’ language will ever be created).

Top Tips To Make Your Soldering Experience Awesome

By With No comments:
Being an electronics engineer you will have to learn to solder some
time in your life, I am sure some or most of you already know the art..
" ART !!! " you will say, Yes soldering is an art, the more you are
good at it the less time it will take and your circuits will look good
as well, no one likes bad soldering work, nor should you, why to
compromise on good enough when it can be awesome, so here are some tips
form me.

1 ). Good Iron: A good quality soldering iron will be your best friend
while soldering, a 25 to 35 watt iron is recommended, if you live in
India Soldron is my favorite brand, its a little costly but will last
you for years and years..

2 ). Iron Tips : The Tip is the business end of a soldering iron, make
sure to change them regularly, and while using them keep them clean.

3 ). Good Quality Soldering Wire : Yes it matters, buy good quality
soldering wire, the less the diameter of the wire the better, less than
.5 mm is recommended, in this way you will not be able to over feed the
solder and less wastage will occur, good quality rosin wire will also
give of less fumes which are harmful to health.

4 ). Atmosphere : Sit in in a well ventilated place, the fumes that
released by solder are not good for health if possible use a fume
extractor fan.

5 ). Per Heating The Iron : Before starting to solder let the iron heat
up for about 10 to 15 minutes, this gets the iron properly heated.

6 ). Keeping Things Handy : Keep all the things you will need handy,
close to you, so that when you start soldering you don't have to get up
to fetch something or another..

7 ). Be Aware : In your hand you have a iron which is HOT and I mean
extremely HOT about 300 to 350 C, so please be careful, you don't want
to get a burn, I have it hurts allot for DAYS !!!

In the end all I want to say is BE CAREFUL !!! And if I have missed any
point write it down in the comments

Compare Microprocessor and Microcontroller.

By With 1 comment:


MicroprocessorMicrocontroller
Microprocessor contains
ALU,general purpose
registers,stack
pointer,
program counter, clock timing
circuit and interrupt
circuit.
Microcontroller contains the circuitry
of microprocessor and in
addition it
has built- in ROM, RAM, I/O
devices, timers and
counters.
It has many instructions to
move data between memory
and CPU.
It has one or two instructions to move
data between memory and
CPU.
It has one or two bit handling
instructions.
It has many bit handling instructions.
Access times for memory and I/O
devices are more.
Less access times for built-in memory
and I/O devices.
Microprocessor based system
requires more hardware.
Microcontroller based system requires
less hardware reducing PCB
size and
increasing the reliability.

Distinguish between the memories mapped I/O peripheral I/O?

By With No comments:






Memory Mapped I/OPeripheral MappedI/O
16-bit device address8-bit device address
Data transfer between any general-purpose register and I/O port.Data is transfer only between accumulator and I.O port
The memory map (64K) is shared between I/O device and system
memory.
The I/O map is independent of the memory map; 256 input device and 256
output device can be connected
More hardware is required to decode 16-bit addressLess hardware is required to decode 8-bit address
Arithmetic or logic operation can be directly performed with I/O
data
Arithmetic or logical operation cannot be directly performed with I/O
data


DC Motor Speed Regulation with A PWM Feed Back System

By With No comments:

DC Motor Speed Regulation with A PWM Feed Back System


Basic PWM
One of the easiest ways of generating an analog voltage from a digital value is by pulse-width modulation ( PWM ). I PWM a high frequency square wave is generated as a digital output. For example, a port bit continuously swiched on and off at a reltive high frequency. The signal is fed to a low pass filter. The voltage at the otuput of filter is equal to ther Roo Mean Squeare ( RMS ) of the squeare wave signal. The RMS of the square wave signal may then be varied by changing the duty cycle of the signal. A cycle is initiated by a low to high transition of the signal and terminates at the next such transition. During one cycle if the time the signal stays high is equal to the time the signal stays low, then the duty cycle is said to be 50 percent.
Figure 1. Duty Cycle 30 %
The following circuit shows a DAC constructed with PWM. The Program controls the speed of a DC motor by pulse widht modulation ( PWM ). Bit P3.0 Drives a switching transistor as shown in the circuit diagram. Motor is swiched on for a period of time, and then off. The fraction of time the motor is on is call the duty cycle.
Microcontroller Motor Speed Control
Figure 2. Pulse widht modulation to Control Motor Speed





This program uses a byte to store the time the motor is on, that is the number of cycles out of 256 cycles while the motor is on. a value of 10 means that the motor is on 10 cycles and off 246 cycles.The duty cycle value is stored in the internal register labeled dCycle. The complement of the duty cycle is similarly stored in register labeled dCycleC. ( Download File : motor.zip )
dCycle   equ 30h
dCycleC  equ 31h
count    equ 32h
Analog0  equ 33h
Analog1  equ 34h
PWM      bit P3.0
Channel  bit P3.1
PortADC  equ P0
DCLB     equ 000h
DCUB     equ 0F0h
MotorCondition bit 20h
;
         org 0h
         ljmp start
         org 0bh
         ljmp Timer_Interrupt0
start:   call Init_Interrupt_Timer0
         clr PWM ; Turn off motor
;==================
; Main Routine
;==================
Forever: call ADC
         call Update
         sjmp Forever
;
;======================
;Subrutine Timer Interruption
;======================
Timer_Interrupt0:
         JB MotorCondition,MotoroFF
         Setb PWM
         Mov TH0,dCycle
         Setb MotorCondition
         reti 
;
Motoroff:clr PWM
         mov TH0,dcycleC
         clr MotorCondition 
         reti 
;
;=========================
;Subrutine Initialize Timer Interrupt
;timer 0 as counter 8 bit mode 2
;========================
Init_interrupt_Timer0:
         mov TH0,#dCycle
         Mov TMOD,#00000010b ;
         setb ET0 ; Enable Timer 0 Interrupt
         Setb EA ; Master Interrupt Enable 
         setb TR0 ; start rock and roll timer 0
         Setb MotorCondition
         mov count,#50
         mov dCycle,#0
         mov dCycleC,#0FFh
         ret
;
;========================
;Subrutine Update - Update duty cycle
;=========================
Update:  djnz count,upDone
         mov A,analog1; reference voltage
         mov b,analog0; tachometer voltage
         clr c
         subb a,b
         jnz update1
         ret
Update1: jc decrease
         call higherDC
         ret
Decrease:
         call lowerDC
UpDone: 
         ret
;
;====================
;Subrutine lowerDC 
;====================
LowerDC: mov a,dCycle
         cjne a,#DCLB,DecDC
         ret
         DecDC: dec dCycle
         inc dCycleC
         ret
;
;===================
;Subrutine HigherDC 
;===================
HigherDC:
         mov a,dCycle
         cjne a,#DCUB,IncDC
         ret
         IncDC: Inc dCycle
         dec dCycleC
         ret
;
;=============
;Subrutine ADC 
;=============
ADC: Clr channel ; Pick channel X0 from multiplexer 4051
     mov Analog0,PortADC
     Setb channel ;Pick channel X1 from multiplexer 4051
     mov Analog1,PortADC
     ret
; 
     end

Keywords:dc motor pwm frequency, dc motor pwm control, dc motor pwm
control arduino, dc motor pwm frequency selection, dc motor pwm circuit, dc
motor pwm vs voltage, dc motor pwm speed control h bridge, dc motor pwm duty
cycle, dc motor pwm control circuit, dc motor pwm driver, dc motor pwm, dc
motor pwm arduino, dc motor pwm avr, dc motor pwm amplifier, dc motor and pwm, dc
motor control pwm arduino, dc motor pwm control avr, dc motor interfacing and
pwm, dc motor control using pwm abstract, dc motor speed control using pwm avr,
dc motor speed control using pwm atmega, controlling a dc motor with pwm, driving
a dc motor with pwm, dc motor pwm back emf, dc motor pwm brake, dc motor pwm h
bridge, dc motor control by pwm, brushless dc motor pwm, brushless dc motor pwm
frequency, dc motor speed control by pwm technique, dc brushed motor pwm
frequency, brushed dc motor pwm, brushed dc motor pwm control, dc motor pwm
current control, dc motor pwm current, dc motor pwm capacitor, dc motor pwm
control torque, dc motor pwm controller ic, pwm dc motor c code, ccs c pwm dc
motor, dc motor pwm driver ic, dc motor pwm drive, dc motor pwm direction, dc
motor driver pwm speed control, motor dc dengan pwm, pengaturan motor dc dengan
pwm, driver motor dc dengan pwm, pwm dc motor drive circuit, dc motor pwm emc, dc
motor pwm emi, dc motor pwm efficiency, dc motor pwm entstören, dc motor
control using pwm efy, pwm en motor dc, speed control of dc motor using pwm efy,
dc motor pwm filter, dc motor fet pwm, dc motor speed control using pwm from
arduino, dc motor speed control using pwm from pic16f628a, pwm dc motor
controller for pic16f877, pwm dc motor transfer function, pwm generator dc
motor, gemini pwm dc motor drive, dc motor control pwm h bridge, dc motor speed
control pwm hho rc controller, 1/2 hp dc motor + pwm speed control, pwm dc
motor hız kontrolü, pwm ile dc motor hız kontrolü, pwm ile dc motor hız ve yön
kontrolü, pwm ile dc motor hız kontrol devresi, dc motor h-brücke pwm, h bridge
dc motor pwm, h-bridge pwm dc motor control, h bridge dc motor driver with pwm,
arduino dc motor h bridge pwm, dc motor pwm ic, dc motor control using pwm in
avr, brushed dc motor driver ic pwm control, how to drive dc motor in pwm, dc
motor interfacing using pwm, pwm in dc motor, speed control of dc motor using
pwm in matlab, igbt pwm dc motor, dc motor pwm kontrol, dc pwm motor speed controller
kit, pwm dc motor controller kit, kendali motor dc pwm, pengaturan kecepatan
motor dc pwm, dc motor hız kontrolü pwm, pwm dc motor kontrol devresi, pwm ile
dc motor kontrolü, pwm ile dc motor kontrol devreleri, dc motor pwm labview, l293d
dc motor pwm, l298n dc motor pwm, arduino l293d dc motor pwm, arduino l298 dc
motor pwm, pwm based dc motor closed loop speed controller, pwm based dc motor
closed loop speed controller.pdf, l298 pwm dc motor schematic, l298 dc motor
pwm, l6203 pwm dc motor circuit, dc motor pwm microcontroller, dc motor mosfet
pwm, dc motor control using pwm microcontroller, dc motor speed control pwm
mach3 speed control, dc motor speed control using pwm method, speed control dc
motor using pwm microcontroller, pwm dc motor control matlab, permanent magnet
dc motor pwm, dc pwm motor speed controller - 15a max, 10a dc motor speed
control pwm mach3, dc motor pwm noise, dc motor speed control pwm using ne555, pwm
dc motor control noise, arduino pwm dc motor, pwm ne555 dc motor, dc motor
control with pwm on atmega, pwm of dc motor, speed control of dc motor pwm, speed
control of dc motor pwm technique, pwm dc motor control based on the arduino
microcontroller, dc motor pwm rate, dc motor speed control using pwm report, pwm
dc motor regulator, raspberry pi dc motor pwm, speed control of dc motor using
pwm research paper, pwm dc motor controller rev.1, dc motor regler pwm, pwm dc
motor controller rev.2, pwm dc motor speed regulator, dc motor pwm speed
control, dc motor pwm soft start, dc motor pwm simulink, dc motor pwm schematic,
dc motor pwm signal, dc motor pwm snubber, dc motor pwm torque, dc motor pwm
theory, dc-motor pwm torque control, dc motor pwm tutorial, dc motor pwm
transistor, dc motor control pwm technique, arduino dc motor pwm transistor, dc
motor control through pwm, dc motor control using pwm technique, dc motor speed
control pwm tutorial, dc motor pwm using 555, dc motor using pwm, dc motor
control using pwm ppt, dc motor control using pwm pdf, dc motor control using
pwm circuit, dc motor control using pwm project report, dc motor control using
pwm arduino, dc motor speed using pwm, dc motor torque vs pwm, 12 volt dc pwm
motor controller, pwm dc motor vezérlés, pwm motor dc vhdl, control velocidad
motor dc pwm, control velocidad motor dc pwm arduino, controlar velocidad motor
dc pwm, control velocidad motor dc pwm 555, dc motor pwm wiki, dc motor pwm
waveform, dc motor with pwm, dc motor with pwm control, driving dc motor with
pwm, controlling dc motor with pwm arduino, dc motor control with pwm circuit, dc
motor speed control with pwm technique, dc motor speed control using pwm with
pic microcontroller, control de motor dc con pwm y pic, pwm y motor dc, control
de motor dc con pwm y puente h, pwm za dc motor, 12v dc motor pwm, 180v dc
motor pwm, 12v dc motor pwm controller, 100a digital dc pwm motor speed
controller, 16f628 pwm dc motor, 16f877a pwm dc motor, 3v dc motor pwm, pwm dc
motor speed control 30 amp, 30a pwm dc motor speed control, pwm para motor dc
30a com pic 16f877a, pwm dc motor controller rev.3, pwm 12v dc motor 30a, 3. dc
motor speed control using pwm technique, 3 amp pwm dc motor controller, dc
motor pwm 555, pwm dc motor controller 50a, 50a-dc-pwm-motor-speed-controller, pwm
dc motor controller 555, pwm dc motor circuit 555, 50a digital dc pwm motor
speed controller, 555 pwm dc motor speed control circuit, pwm dc motor control
using 555 timer, speed control of dc motor using pwm 555, 6v dc motor pwm, dc
motor control using pwm 8051, dc motor speed control using pwm 8051, 8051 dc
motor pwm, dc motor speed control using pwm 8051 project, dc motor speed
control using pwm 8051 ppt, pwm control dc motor using 89c51, 8051 pwm dc motor
speed control,


Makes LED blink every 0.5 second C Programming 8051

By With No comments:
A basic circuit of the 89C2051 shown here can be made easily using point-to-point soldering with a universal PCB. Use an ordinary 20-pin socket, do not use a circle-pin socket. D1 is a small dot LED. U2 can be either 7805 or 78L05. U3 is optional for correcting any polarity DC adapter. Without the 2051 chip in the socket, checks the connection, then measures +5V between pin 20 and pin 10. Test the LED by shorting P1.7 pin to GND.



Test your board with myfirst.c, a simple c program 
that makes LED blink every 0.5 second. 
/* 










           * myfirst.c 
           * First C program for 2051 experiment 
           * complement P1.7 every 0.5 sec 
           * Copyright (C) 1999 Wichit Sirichote 
           * compiled with Dunfield Micro-C for 8051 Release 3.2
           */ 
#include c:\mc\8051io.h /* include i/o header file */
           #include c:\mc\8051reg.h 
extern register char cputick; 
// cputick was incremented every 10ms            
   register unsigned char sec100,flag1; 
#define n 50 
task1(); // functions declarations 
           task2(); 
main() 
{ 
 flag1 = 0; 
 sec100 = 0; 
 serinit(9600); // set timer0 to be 16 bit counter 
 while(1){ 
 while(cputick == 0) 
 ; 
 cputick = 0; 
 task1(); 
 task2(); 
 } 
} 
task1() // set bit 0 of flag1 every n*10ms 
{ 
 sec100++; // increment sec100 
 if (sec100 >= n) 
 {sec100 = 0; // clear sec100 
 flag1 |= 0x01; // set bit 0 of flag1 
 } 
} 
task2() 
{ 
 if ((flag1 & 0x01) != 0) // execute below if bit 0 of flag1 is set
{ 
  // P1 ^= 0x80; // exclusive or the latch bit 7 with 0x80 
  asm " CPL P1.7"; // complement P1.7 
  flag1 &= ~0x01; // clear bit 0 of flag1 
 } 
}