A picocontroller training simulator in a Web page

International Journal of Electrical Engineering Education, Apr 2003 by Collier, M

Abstract

A software simulator hosted in a Web page is described, and the evaluation of its effectiveness by students of the National University of Science and Technology in Zimbabwe is discussed. The processor which is simulated is the PIC16F84 picocontroller, and the screen display shows the source program, RAM locations and Special Function Registers. To minimise the size of the package, the functionality has been reduced so that it only displays a set of sample programs representing a number of key techniques in the programming of the device. Users can step through programs observing the memory changes to facilitate an understanding of the operations.

Keywords software simulation; web-based training

With the pace of development in electronics, the training and education of engineers demands a steepening of the learning curve if students are to familiarise themselves quickly with new devices. This is particularly true in the case of programmable integrated circuits, where familiarity with the interaction between software instructions and hardware architecture is essential to achieving design expertise. The plethora of new offerings in this field is a stimulus to the introduction of rapid-learning techniques into the classroom environment.

Among the devices introduced in the electronic engineering degree course at the National University of Science and Technology (NUST) in Zimbabwe is the picocontroller. This variant of the microcontroller provides a flexible, cheap processing unit which lies at the heart of many student projects and industrial consultancies in the country. Consequently it is necessary for students to gain a solid grasp of the intricacies of the hardware and the programming techniques as swiftly as possible. Therefore the regular lecture course and laboratory sessions have been complemented by the provision of a training simulator on the departmental Intranet.

The requirements of the simulator were that it should be easy to access, provide several selectable sample programs, and cover a some of the more intricate skills necessary to utilise the chip effectively.

Details of the picocontroller

One of the devices which have been chosen for teaching and project work in the embedded computer systems course at NUST is the P1C16F84,1 which is an 8-bit microcontroller manufactured by Microchip. This version incorporates a considerable amount of EEPROM program memory, which can be rapidly downloaded and erased. In consequence the design and development cycle can be shortened because rapid iterations in program development are possible. The basic hardware structure of the PIC16F84 is shown in Fig. 1. Input/output facilities of the device include:-

1 One 8-bit bi-directional port.

2 One 5-bit bi-directional port, of which one line is open-collector.

3 One external interrupt input.

4 One counter input.

Versions are available for either 4MHz or 10 MHz clock oscillators, which may be implemented using R-C circuits or crystals. A reduced instruction set of opcodes provides single-cycle execution of most instructions, resulting in fast performance, which is further enhanced by a two-stage instruction pipeline.

The device incorporates 36 bytes of user RAM, known in Microchip terminology as File Registers. A further 64 bytes of non-volatile data memory is available for storage and retrieval by the program.

In common with most microcontrollers the PIC utilises a bank of Special Function Registers (SFRs) for controlling the hardware parameters. These are summarised in Table 1.

The concept of an embedded applet

The advent of the Internet has made possible access to information in a structured and standardised manner. Within the Electronic Engineering Department at NUST, a local area network based on the Windows-NT operating system provides an Intranet that is available to both students and staff.

One way to implement the software simulator for the picocontroller would be to make it available as a downloadable file from the system server. This would require the user to download the file and then execute it. A more user-friendly approach has been adopted by providing the simulator within an Internet web page, which is ready to run as soon as the page is displayed.

The page contains the simulator in the form of an interactive applet, which accepts input through mouse clicks on screen buttons, and displays values of the registers within the picocontroller.

Since the access time to the Internet page needs to be kept low, especially if it is being accessed by a remote site on the Internet, the size of the applet code has been reduced to the minimum consistent with the educational objectives of the simulator. As a result the range of activity has been deliberately restricted to allow basic familiarisation with the picocontroller, without providing full functional simulation.

The facilities of the simulator

Upon opening the Web page, the user is presented with the screen display shown in Fig. 2, from which a sample program may be selected. On mouse-clicking the selector box, a menu of programs highlighting various programming techniques is offered, as seen in Fig. 3. Once a program has been chosen, the source code appears in the left-hand window together with a red bullet indicating the next instruction to be executed.


 

BNET TalkbackShare your ideas and expertise on this topic

Please add your comment:

  1. You are currently: a Guest |
  2.  

Basic HTML tags that work in comments are: bold (<b></b>), italic (<i></i>), underline (<u></u>), and hyperlink (<a href></a)

advertisement
CXO UnpluggedSmart Business interviews on BNET

See and hear how senior level executives across the Asia Pacific are developing smart business ideas across a variety of sectors. The focus is on the future, and on how businesses need to evolve.

advertisement
  • Click Here
  • Click Here
  • Click Here
advertisement

Content provided in partnership with ProQuest