Web Hosting

Lecture 37 : Simulator and Programmer for 8051

Simulator and Programmer for 8051
A simulator is a software to mimic a microcontroller operation with a Personal Computer. This helps in running the assembly language program off-line and debug for errors. This is also a powerful learning tool before actually working with a Microcontroller.
A programmer is a hardware used to transfer the machine code to the internal program memory of a microcontroller.

In this section we will see a typical Simulator and a Programmer used for Atmel AT89C51.
Working with Win8051 Simulator
Win 8051 is a simulator for 8051 microcontroller to write and edit the code in assembly language, compile it and also to run the code. Output of the assembly language program can be verified using simulator.
Steps to Use WIN8051
  • After installing the software Win8051, open 8051 IDE.
  • To write the assembly code in the editor , go to :
    File  New
  • After writing the assembly code in the editor, assemble the code (Assemble)
  • Check for the errors in the output window
    View  Output
  • Once the error free code was made, simulate the code.
    Simulate  Start Simulator
  • Simulator options are
    1. Step into - Each time only one instruction will be executed (single step mode).
    2. Continue - To run the whole code at once.
  • Additional things:
    1. To view RAM, program memory, SFRs, and External memory use the option VIEW .
    2. To set break points in the code (where simulation stops at that point)
      Simulate  Toggle Break Point
  • To stop the simulation
    Simulate  Stop
After checking the code in the simulator, the code (file with .HEX extension in  Intel HEX format) is loaded into Atmel 89C51 microcontroller using Universal SP3 Programmer. Although a separate 8051 assembly can be used at times assemble and generate Hex code for a assembly language program, Win8051 simulator can perform that task here.
Programming with Universal SuperPro III Programmer:
SuperPro III (SP3) Programmer is manufactured by XELTEK. This is a universal programmer that can be used to program a host of Microcontrollers and EPROMs. This is connected to PC by the parallel port. A software "SP3.EXE" is executed by the PC to establish a communication with the programmer. Hex files can be downloaded from the PC to an EPROM or the program memory of a microcontroller located in ZIF socket on the programmer.
 
Fig 37.1   A view of SuperPro III Universal Programmer
The programmer is used to load HEX code into the microcontroller (Atmel 89C51 in the present case).
Steps:
  • Run SP3.exe
  • Selecting the device to be programmed.
    Device  Select by Device  select AT89C51, type MPU/MCU  Select
  • Loading file in to the buffer .
    File  Load  Select FILE_NAME.HEX to be loaded  check INTEL file format  OK
  • To edit or to view the file to be loaded
    Buffer  Edit
    (HEX code with corresponding memory location addresses to be loaded into will appear on the screen)
  • To load the program in to the microcontroller
    Device  Run
    (Place the microcontroller in the slot provided in the Universal SP3 programmer)
    • Select Blank check  OK
    • If blank check is failed, Select option Erase  OK
      If blank check is a success, proceed to next step.
    • Select Program  OK
    • Select Blank check  OK (it must fail which implies HEX code is programmed in to the microcontroller)
  • Remove microcontroller from the slot.
  • Exit SP3.exe
    File  Quit
 

No comments:

Post a Comment