Theory - 05: 8051 Development Tools and Environments

Introduction:

The goal of an Embedded System Development Environment is to enable a developer to create the application firmware for a Microcontroller Control Unit (MCU) based hardware design. Application development consists of five steps:

  • Coding - writing the application in a humanly readable form
  • Building - converting the humanly readable code to a machine-readable code
  • Simulation - verifying the application will work before it is programmed into an MCU
  • Programming - placing the machine-readable code into the MCU's non-volatile program memory
  • Debugging - identifying and removing any unforeseen anomalies in operation after the application has been programmed into the MCU
Fig: Embedded Development Environment

The primary component of a contemporary development system is a software package called an Integrated Development Environment (IDE). IDEs provide a user interface for the application developer to coordinate the development activities. Depending on the developer's needs, the IDE may communicate with other software packages called compilers and hardware devices called programmer/debuggers.

Coding :

Applications are developed by writing code using languages such as C or assembly. The code is placed in text files, called source files, on the developer's computer. An embedded application typically consists of multiple source files. The content and format of the source files are determined by the language being used.

In order to enable efficient development, IDEs include a text editor and the ability to create and manage multiple source files.

Building :

Once the source files have been written, they need to be converted to a form which is readable by the MCU. The process of converting source files to a format which can be read by an MCU is called building. A build is a two-step process:

  • Each application source file is converted to a machine-readable file called an object file.
  • The object files are then linked together, forming a single application file which can be programmed into the MCU.

Building is performed by a software tool called a compiler. IDEs offer a user interface, allowing the developer to start the build process by invoking the compiler.

Simulation :

Improperly written applications can cause damage to the external hardware or the circuity of a development board. Many developers wish to determine if their application is functioning properly before they program it into an MCU. The process of verifying an application's operation before it is programmed is called software simulation.

Software simulation is a feature offered by the IDE. After a project is built, and before it is programmed into the MCU, the developer can run an interactive software simulation of the code.

Programming :

Placing a built application file into an MCU's program memory requires the use of a hardware device called a programmer ( or programmer/debugger). A programmer typically connects to the developer's computer through USB and to the MCU through the MCU's specified I/O pins. After a build has been completed, using the IDE, the developer initiates the programming of the built application file into the MCU.

Debugging :

Sometimes, after an application has been coded, built, and programmed into an MCU, it performs differently than the developer expects. To identify and correct the causes of these anomalies, the developer will need to "see" what the MCU sees as it executes the application code. The process of controlling an MCU's operation and observing its performance is called debugging (or hardware debugging).

Debugging is performed through the IDE and requires the device programmer to have a set of enhanced capabilities. The programmer must have the ability to pass control signals from the IDE to the MCU and return data from the MCU to the IDE. Enhanced programmers are referred to as programmer/debuggers.

MIDE-52 Software

MIDE-51 is freeware Integrated Development Environment (IDE) for MCS-51 microcontroller developed by OpCUBE. The full package already comes with: Assembler, SDCC (Small Device C Compiler), TS Controls 8051 Emulator and many more.

Fig: MIDE-51 IDE Interface

MIDE-51 Features:

  • Syntax highlighter on keywords, registers, operands, comments etc.
  • Support multi document work space
  • Support standard editor feature and shortcut key such as Cut , Copy, Paste, Find, Replace and Windows tile & cascade
  • Editor font style and size selectable
  • Save recent file(s) opened in and automatic save last windows position.
  • Report assembler & compiler message
  • Support drag and drop file from explorer.
  • Support wheel mouse
  • Bookmark code position up to 10
  • Show/Hide line number on editor and many more.
DOWNLOAD

Tested version from drive: MIDE-51 (vr.2.01)

How to use MIDE-51 IDE?

The M-IDE Studio for MCS-51 is the primary means for performing compiling for the MCS-51 devices. The M-IDE Studio for MCS-51 has a comprehensive set of features that allows you to edit, compiling, and debugging file.

The M-IDE Studio for MCS-51 also allows you to write a programming language with c programming. Using the software, you can see the errors by viewing messages.

Fig: MIDE-51 First Screen

You will notice that most of the toolbar buttons and menu options are disabled. This is because a file has not been made. To make a file, do the following:

Steps of writing a program

New File - To make a new file, click on File menu or shortcut as shown in figure 1, after made a new file, then you’ll see the page look similar as figure.

Fig: MIDE-51 New File Screen

Writing a Program - To implementation the program, you may write the assembly program in blank file. After writes the program, see that is no colour in the page.In this case you must save the program as shown in figure.

Fig: MIDE-51 New File

Save As - Save your file with extension according to your program, in this case if your program is Assembly then you must save the file with extension *.ASM, as shown in figure.

Fig: MIDE-51 Saveas

After saving the program you will see the program with colour, this indicates that the mnemonic is right reserved, as shown in figure.

Fig: MIDE-51 Compile Code

Compiling - To load the file into your device, you need to comile the file *.ASM tobe HEX file. To compiling file *.ASM into *.HEX you can click shortcut as shown in figure.

Troubleshooting Error - Assembly errors apply to the consistency of the assembly language program in syntax and semantics. If one of these errors is detected, it is flagged in the list file, and program execution continues.

Fig: MIDE-51 Compiler Errors

Proteus - Simulator

Proteus is a simulation and design software tool developed by Labcenter Electronics for Electrical and Electronic circuit design. It also possess 2D CAD drawing feature. It deserves to bear the tagline From concept to completion.

Fig: Proteus Simulator Option

It is a software suite containing schematic, simulation as well as PCB designing.

  • ISIS is the software used to draw schematics and simulate the circuits in real time. The simulation allows human access during run time,thus providing real time simulation.
  • ARES is used for PCB designing.It has the feature of viewing output in 3D view of the designed PCB along with components.
  • The designer can also develop 2D drawings for the product.

Proteus Features :

  • Common Parts Database – Unified database of all parts and elements in the current project. Enables automatic updating of data between Proteus modules (e.g. Schematic and PCB)
  • Live Netlisting – Alive netlist is now maintained and accessible throughout the system. Enables changes on the schematic to be reflected across PCB, BOM and Design Explorer in real time.
  • 3D Viewer – Now supports DirectX (as well as OpenGL) and runs multi-threaded. Includes live update mechanism so changes made in ARES are reflected in the 3D Viewer.
  • Bill of Materials – Completely new BOM module with PDF , HTML and Excel output. New Property Editor grid allowing you to easily add data to the report.
  • VSM Studio –Integrated IDE for Proteus VSM simulation and debugging. Automatically sets up compilers and debugs target firmware.
DOWNLOAD

Tested version from drive: Proteus (vr.8.7)

ISIS - Proteus Schematic Drawings

ISIShas wide range of components in its library. It has sources, signal generators, measurement and analysis tools like oscilloscope, voltmeter, ammeter etc., probes for real time monitoring of the parameters of the circuit, switches, displays, loads like motors and lamps, discrete components like resistors, capacitors, inductors, transformers, digital and analog Integrated circuits, semi-conductor switches, relays, microcontrollers, processors, sensors etc.

Fig: Proteus ISIS

ARES - Netlist and PCB Layout

ARESoffers PCB designing up to 14 inner layers, with surface mount and through hole packages. It is embedded with the foot prints of different category of components like ICs, transistors, headers, connectors and other discrete components. It offers Auto routing and manual routing options to the PCB Designer. The schematic drawn in the ISIS can be directly transferred ARES.

Fig: Proteus ARES

Programmer AVRDUDE

AVRDUDE is a utility to download/upload/manipulate the ROM and EEPROM contents of AVR microcontrollers using the in-system programming technique (ISP).

Fig: AVRDUDE Programmer Software Interface

AVRDUDE - AVR Downloader Uploader - is a program for downloading and uploading the on-chip memories of Atmel’s AVR microcontrollers. It can program the Flash and EEPROM, and where supported by the serial programming protocol, it can program fuse and lock bits. AVRDUDE also supplies a direct instruction mode allowing one to issue any programming instruction to the AVR chip regardless of whether AVRDUDE implements that specific feature of a particular chip.

DOWNLOAD

Tested version from drive: AVR DUDE (vr.2.01)

Installation Process (Windows 7, 8 and 10)

To install programmer collect required file (.zip) from your teacher or download from the following link https://goo.gl/EjSA6Z

Extract the .zip file and open the extracted folder.

Install WinAVR-20100110-install.exe

Copy avrdude.conf and paste to C:\\WinAVR-20100110\\bin If there is already a file with the same name, replace it with the new one.

Install setup-AVRDUDESS-2.4.exe

Open USBasp Driver folder and Install InstallDriver.exe After completing installation it should look like this-

Fig: USB asp Setup

Connect your AT89xx Microcontroller Development Board to PC using USB cable.

Device driver installation notification should pop up on system tray of your PC. It should be look like this-

Fig: USB asp Setup Success

Open AVRDUDESS from the desktop shortcut.

You have to configure AVRDUDESS (once). Click on options configure avrdude location to C:\\WinAVR-20100110\\bin and click OK

Fig: USB asp Configuring
Fig: USB asp Binary Configuring

Downloading HEX file to your microcontroller board.

On your AT89xx Microcontroller Development Board set Enable Programming jumper and Power from USB jumper (they are close to reset switch).

Fig: USB asp Power Options

Connect your Board to PC using USB cable.


Open AVRDUDESS.

  • Select programmer > USBasp
  • Select MCU > AT89S52
  • Select flash (.hex) file
  • Check Force (-F), Erase flash and EEPROM (-e) and Disable verify (-V)
  • Now click on Program!
Fig: USB asp Configuration

To run the program open Enable Programming jumper (beside reset switch).

ATMEL PRO Development Kit

The Explore ATMEL PRO Kit comes with all the things required, not just for this experiment but for the entire series. The base board is fully open, no peripheral is directly connected to the MCU breakout board. You may connect any peripheral to any port/pin you wish. The kit is fully open source, you may use the schematics, the design files and all of the source code and build something cool on your own.

ATMEL PRO is simple but powerful board which uses the MCU AT89S52 from Atmel. With its variety of interfaces this board is suitable for different embedded systems applications.

The ATMEL PRO evaluation board supports all operating modes of the 8051 and 251 microcontrollers and lets you become familiar with the different modes of these devices.

Fig: Microcontroller Development Board

Board Features

Fig: Dev Board Features

The story of the Kit does not end here. The kit ships with all the additional stuff mentioned below to get you started; kickstart your embedded development. What are you waiting for?

  • DIP 40 Pin ZIF (Zero Insertion Force) Socket. For Easy Insert/Remove of IC.
  • 8051 Development Board Support AT89S51, AT89S52, P89V51RD2, etc. 40-Pin DIP Chip.
  • USB Programmer can be used for both 8051 and AVR ICs.
  • On-Board 5 mm Power Plug-in DC Jack
  • On-Board 5V regulator (LM7805) and 3.3V regulator circuit.
  • On-Board Power ON-OFF switch and power indication RED LED.
  • On-Board 4 Input User Switches (pulled up internally).
  • On-board Quartz Crystal 11.05892 MHz
  • Port Extensions for all PORT with Detailed Pin Labeling for Easy Identification of Pin
  • External Pull-Up resistors for Port 0
  • On-board Reset button
  • Dimensions: 120x38 mm (4.7x1.5")

Package Content

  • ATMEL PRO Evaluation Board.
  • ATMEL PRO Evaluation Board User’s Guide (this manual),
  • Power Adapter (12v 1a External)
  • Motor (DC and Stepper)
  • Keypad Matrix (Membrane Type)
  • Connectors (M2M, M2F, F2F)
  • Softcopy CD( MIDE-51, PROTEUS, PICKIT2, Data sheets and Notes.).

BOARD USE REQUIREMENTS:

Lesson Video

Prev topic: 8051 Assembly Programming Next topic: LED Interfacing with 8051