Introduction to the M16C Microcontroller

Authors Avatar

Thomas Osgood        Page         06/02/2009

ES2A2 Computer Systems

Assignment ES2A2A4 – Introduction to the M16C Microcontroller

Thomas Osgood – 0504962

Contents

  1. Introduction                                                3

  1. Description                                                3

  1. Conclusions                                                6

  1. Appendix: Commented Program                7

Introduction

This experiment was performed using a software called IAR embedded Workbench and MI6 micro-controller. To show the use of IDE a simple program was written and its debugging procedure after that the pre-made program was compiled and executed onto the microcontroller. This program controlled one of the on board 7 segment displays to output a repeating count from 0 to 9.  

Description

The software called IAR embedded workbench is extended to accompany all the microprocessors side-lines. The program used for the lab will incorporate input/output port, timer and interrupt system

Intially all the arrangement was set to default and the program was made to run using the right BIOS file then to make few simple calculations I wrote a new program using project. After finishing the program it was loaded onto the debugger program called C spy This program allows the  user to  implement the program and find any mistakes and correct them.   It also allows nominated variables to be added to a watch window which gives the real time value and gives an indication each time the value changes.

For the second part of the lab I used a small printed circuit board featuring a M16C microprocessor along with some basic outputs. The board incorporates the following main features: 4 push to make input buttons, 2 seven segment displays, a potentiometer combined with an analogue to digital converter, a serial connector for communication with a PC, power connectors and crystals to create clock signals for the processor.

Join now!

In this lab only the 7 segment displays are of importance, the pre-written test program provided uses the input/output ports to make the second display count from 0 to 9 repeatedly. The program is loaded into the IDE and appropriate changes are made to set the IDE to ‘ROM Monitor Mode’ which means that the complied program is now to be executed on the external microprocessor via the serial link. Before looking at the program this is what I understand about the hardware:

The displays are both connected to the P0 input/output port with identical connections. i.e. if ...

This is a preview of the whole essay