8051 – Programming Technique

8051 on C programming technique

  • How to Declare a Spacial Function Register(SFR)
    •  Definitions for P1 (8 bits), P1.0, and P1.1.  sfr P1 = 0x90; /* SFR for P1 */
  • How to Declare a Bit in Bit Addressable Spacial Function Register(SFR)
    • sbit P1_0 = P1^0; /* SFR for P1.0 */ 
    • sbit P1_1 = P1^1; /* SFR for P1.1 */
  • How to configure an I/O Port pin as an INPUT
    • P1_0 = 1; //configure as InPut
  • How to configure an I/O Port pin as an OUTPUT
    • P1_0 = 0; //configure as OutPut
  • How to read INPUT pin
  • How to read OUTPUT pin

8051 on ASM programming Techinue

  • (file_name.asm) Assembly language is human programming language
  • (file_name.obj) Object file
  • (file_name.lst) List files
  • (file_name.abs) Absolute Object file
  • (file_name.hex) Hexadecimal file

 


Difference Between C code and equivalent Assembly code

  •  Empty Project code for 8051

  •   LED define and initialize  Project code for 8051


What is Intel Hex File?

  •  Intel-Standard Hex file format is one of the commonly used format in the microcontroller world
  • This standard is used to burn the 8051/52 program into an EPROm, PROM etc,
  • 8051 Assembler generate the Intel Standard Hex file, it can be loaded into EPROM programmer.
  • Intel HEX is a file format that conveys binary information in ASCII text form.
  • It is commonly used for programming micro-controllers, EPROMs, and other types of programmable logic devices.
  • In a typical application, a compiler or assembler converts a program’s source code (such as in C or assembly language) to machine code and outputs it into a HEX file.
  • The HEX file is then imported by a programmer to “burn” the machine code into a ROM, or is transferred to the target system for loading and execution.

Hex file format

  • Position : 1 – Record Marker.
  • Position : 2-3 – Record Length.
  • Position : 4-7 – Address.
  • Position : 8-9 – Record Type.
  • Position : 10-? – Data Type.
  • Last 2 Character : Checksum.
  • Eg :  0300300002337A1E
    • Position : 1 – Record Marker. – 03 (3 Byte of Data)
    • Position : 2-3 – Record Length. – 0030(3 Bytes will be stored at 0030, 0031 and 0032)
    • Position : 4-7 – Address. – 00 (Normal data)
    • Position : 8-9 – Record Type.- 02,33, 7A.
    • Position : 10-? – Data Type.- 1E
    • Last 2 Character : Checksum.

 


8051 Hex Code Visualizer

                       Introducing the 8051 Hex Code Visualizer, brought to you by SpiceLogic Inc. This is a very simple tool targeted to solve only one problem. And that is visualizing the INTEL Hex Code that is generated targeting 8051 8 bit Micro-controllers. This tool will give you the complete understanding on how the Hex Code resides in the Memory of 8051 Micro-controllers. It is completely FREE and made for educational purpose. Get the app from

 


 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

if you have any queries call us +918300026060 or WhatsApp Dismiss

0

Your Cart

%d bloggers like this: