First Steps with Embedded Systems Byte Craft Limited 02A4 A ox40; 02A6 B gs&0x20) 02A9 C table(); [email protected] Code Development Systems CDS m The Byte Craft Limited Code Development Do Byte Craft Limited compilers Systems are high-performance embedded support ANSI C? o development packages designed for serious All Byte Craft compilers are ANSI compatible within the developers. They generate small, fast, and limitations of the target hardware. efficient code. They enable the professional How efficient is the optimizer c developer to produce stand-alone single-chip compared to hand-written . microcontroller applications quickly. Developers assembler code? can easily port C language applications written The compiler generates object code as tight and t for other embedded platforms to the CDS. efficient as most hand-written assembler code. f Can I combine C code and www.bytecraft.com assembler in my programs? You can embed assembler code within your C program, a Features using #asm and #endasm preprocessor directives. The ! The Code Development Systems support embedded code can call C functions and directly r entire families of microcontrollers. access C variables. To pass arguments conveniently, ! The optimizing C language cross-compilers are embed your assembly code in the body of a C function. c ANSI-compatible within hardware limitations. What kinds of emulator hardware ! Tight, fast and efficient code optimization do the compilers support? For more information on supported emulator products, generates clean, customized applications. e ! A built-in Macro Assembler allows inline contact Byte Craft Limited support staff. assembly language in C source. How do the compilers handle local t ! CDS generate symbol and source reference variable declarations? Our compilers store locally-declared variables in information for C source-level debugging with y reusable local memory spaces. The scope of local popular emulators. ! variables is protected. C language support for interrupt service What are Byte Craft Limited's b routines and direct access to ports. ! terms? Device files for individual parts precisely For Canada and the U.S.: For company purchases (on control code generation and resource usage. ! approved credit), NET 30 days after shipping. Byte @ Complete user documentation comes with Craft ships next day FedEx free of charge. All other every Code Development System. ! orders must be prepaid, with American Express, VISA, Absolute Code Mode lets you compile directly check with order, or direct wire transfer. o to final code without a separate linking phase. For overseas: All orders, prepaid with American Alternatively, you can use the BClink Express, VISA, check with order, or direct wire transfer. f Optimizing Linker. Either method performs a Shipping is extra. Please call for more information. Please obtain appropriate import documentation. final optimization pass on an entire program. n ! Demonstration versions are available from: If for any reason you are unsatisfied with your i http://www.bytecraft.com/ purchase, you can return it within 30 days for a full Versatility refund. Code Development Systems install under Windows 95, 98, ME, NT, 2000, or under MS/PC 421 King Street North DOS. Waterloo, Ontario CDS provide symbol table information and a Canada listing file: a merged listing of C source and N2J 4E4 generated assembly language to permit detailed Tel: 519-888-6911 Fax: 519-746-6751 analysis. First Steps with Embedded Systems by Byte Craft Limited BYTE CRAFT LIMITED 421 King Street North Waterloo, Ontario Canada N2J 4E4 Telephone: (519) 888-6911 FAX: (519) 746-6751 Email: [email protected] http://www.bytecraft.com Copyright ! 1997, 2002 Byte Craft Limited. Licensed Material. All rights reserved. First Steps with Embedded Systems is protected by copyrights. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise without the prior written permission of Byte Craft Limited. All example and program code is protected by copyright. Printed in Canada 14 November, 2002 Table of Contents 1. Introduction 1 1.1 Typographical Conventions....................................................................... 1 1.2 Explaining the Microcontroller .................................................................2 1.3 Book Contents ...........................................................................................3 2. Microcontroller Overview 5 2.1 What is a Microcontroller?.........................................................................5 2.2 The Microcontroller in a System...............................................................7 2.3 Architecture ...............................................................................................7 2.3.1 Von Neumann ......................................................................................................................8 2.3.2 Von Neumann Memory Map.............................................................................................8 2.3.3 Harvard ..................................................................................................................................9 2.3.4 Harvard Memory Map.......................................................................................................10 2.3.5 The Central Processing Unit ............................................................................................11 2.3.6 Central Processing Unit.....................................................................................................13 2.3.7 ROM.....................................................................................................................................14 2.3.8 RAM.....................................................................................................................................15 2.3.9 I/O Ports.............................................................................................................................16 2.3.10 Timer..................................................................................................................................17 2.3.11 Interrupt Circuitry............................................................................................................18 2.3.12 Buses ..................................................................................................................................19 2.4 Sample Microcontroller Configurations.................................................. 19 2.4.1 Motorola MC68HC705C8 ................................................................................................19 2.4.2 National Semiconductor COP8SAA7 ............................................................................20 2.4.3 Microchip PIC16C54.........................................................................................................20 2.4.4 Microchip PIC16C74.........................................................................................................21 i Table of Contents 3. The Embedded Environment 23 3.1 The Embedded Difference ......................................................................23 3.2 Fabrication Techniques ..........................................................................24 3.3 Memory Addressing and Types ..............................................................24 3.3.1 RAM..................................................................................................................................... 24 3.3.2 ROM.................................................................................................................................... 25 3.3.3 PROM ................................................................................................................................. 25 3.3.4 EPROM .............................................................................................................................. 25 3.3.5 EEPROM ........................................................................................................................... 26 3.3.6 Flash Memory..................................................................................................................... 27 3.3.7 Registers .............................................................................................................................. 27 3.3.8 Scratch Pad ......................................................................................................................... 28 3.4 Interrupts .................................................................................................29 3.4.1 Interrupt Handling ............................................................................................................ 30 3.4.2 Synchronous and Asynchronous Interrupt Acknowledgement................................. 30 3.4.3 Servicing Interrupts........................................................................................................... 31 3.4.4 Interrupt Detection ........................................................................................................... 32 3.4.5 Executing Interrupt Handlers.......................................................................................... 33 3.4.6 Multiple Interrupts ............................................................................................................ 34 3.5 Specific Interrupts ...................................................................................34
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages228 Page
-
File Size-