Download Introduction To The C Language
Transcript
1. Overview 1.1 Course Introduction This course is intended as a basic introduction to C166 microcontroller programming. It will teach you the basic skills and techniques required to produce efficient C166 programs and give you some ideas how the powerful peripheral set can be employed. A learning-by-doing approach will be taken so that you will have a chance to try new language features straight away. A working C167CR-based microcomputer is provided, equipped with our HiTOP source level debugger with which programs can be tested. Many examples make use of the C167's powerful and innovative peripheral set so that you will gain an appreciation of how they can be applied in your own projects. It is assumed that you are familiar with the fundamentals of the C language and have some experience of assembler programming, preferably on the C166 family. We make no apologies for showing some of the underlying assembler produced by the C166 compiler in those cases where misuse of compilation controls can cause program problems. Each language feature is covered by a programming exercise. You have the choice of creating the program from the specification given or using the “shell” modules, which have the basic framework of the required program already mapped out. You will find complete working versions in the SOLUTION subdirectories from which you can take ideas, or use as is! The outlines of the examples can be found the WORK subdirectories for you to complete. The content is based on the most common questions asked by C166 users and our own experience of what really counts in C166 programming. It is unlikely that you will remember everything once you start using C166 for real but what you will find is that you’ll be able to refer back to the notes should anything difficult crop up. You will not end the course as a C166 expert but you will be in a position to start a major development, armed with the basic knowledge to ensure its success. We will use the Keil uVISION Windows integrated development environment as the means of creating and compiling the exercises and HiTOP to debug them. The built-in uVision editor is an entirely main-stream Windows programming editor, with automatic error and syntax highlighting and should be familiar to anybody who has used a Windows word processor, Codewright or PFE. Hitex's HiTOP is a flexible source-level debugger for the C166 family, being used here in its monitor version. 1.2 Basic Objective In C166 Programming To acheive the fastest possible execution by using only the C language, leading to... => Fastest system response to real time events => simpler, more maintainable code => cheaper EPROMs & RAMs => smaller bus width. => lowest system cost © Copyright Hitex (UK) Ltd 1999 C166 Introduction Page 6