programming the 8051 microcontroller

Thread Starter

HSMBELE

Joined Apr 7, 2010
6
hey i have been working with the 8051 microcontroller at d last 2 months. I find difficulty in programming it, can anyone help me by giving me ways to actually see and write a programme when i write a test? please!
 

Papabravo

Joined Feb 24, 2006
21,227
There are two aspects to "programming" and I'm not clear which one of them is giving you a problem.

  1. Given a set of requirements, can you write a series of instructions that implements that set of requirements. This is referred to as "writing a program".
  2. Given a program that has been "written" and then assembled or compiled, how do you get that program into a memory that is accessible by the processor. This is referred to as "burning a program"
The "burning a program" terminology comes from a time when Read Only Memories, Or ROMs, were implemented with "fuse links" that had to be "burned out" in order to turn a "1" into a "0" or vice-versa in the early examples of ROMs.

Given that long winded explanation, which one of those problems are you having trouble with?
 

Papabravo

Joined Feb 24, 2006
21,227
In order to write a program for the 8051 it helps to know what resources you have at your disposal. There are three resources that you should concentrate on at the beginning

  1. Program memory, where the instructions are held. This memory is addressed by the Program Counter Register. In the MOVC instruction it is also addressed by the Data Pointer.
  2. Data memory, where the data is held. This memory can be directly addressed in an instruction, indirectly addressed through an 8-bit register, and indirectly addressed through the 16-bit data pointer
  3. Special Function Registers. These are directly addressed registers used to control, activate, and monitor the peripheral devices.
Once you have a handle on these three things it becomes much easier to conceptualize and "write" a program.
 
Top