Proyetos con pic

Páginas: 36 (9000 palabras) Publicado: 9 de septiembre de 2010
Microcontroller Projects in C for the 8051

This Page Intentionally Left Blank .

Microcontroller Projects in C for the 8051
Dogan Ibrahim

OXFORD AUCKLAND BOSTON JOHANNESBURG MELBOURNE NEW DELHI

Newnes An imprint of Butterworth-Heinemann Linacre House, Jordan Hill, Oxford OX2 8DP 225 Wildwood Avenue, Woburn, MA 01801-2041 A division of Reed Education and Professional Publishing LtdA member of the Reed Elsevier plc group First published 2000 # Dogan Ibrahim 2000 All rights reserved. No part of this publication may be reproduced in any material form (including photocopying or storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication) without the written permission of the copyright holder except inaccordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London, England W1P 9HE. Application for the copyright holder's written permission to reproduce any part of this publication should be addressed to the publishers British Library Cataloguing in Publication Data A cataloguerecord for this book is available from the British Library ISBN 0 7506 46403 Library of Congress Cataloguing in Publication Data A catalogue record for this book is available from the Library of Congress

Tyeset by David Gregson Assciates, Beccles, Su€olk Printed and bound in Great Britain

Contents

Preface Chapter 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 Microcomputer Systems

vii 1 1 1 23 4 4 10 11 12 13 15 16 16 16 17 17 18 18 18 19 19 19 20 21 22 22 24 24

Introduction Microcontroller Evolution Microcontroller Architecture 8051 Family Architecture of the 8051 Family Pin Con®guration Timer/Counters Interrupt Control Minimum Microcontroller Con®guration Project Development Programming Microcontrollers in C

Chapter 2 2.1

2.2 2.3 2.4 2.5

Data Types 2.1.1 bit 2.1.2 signedchar/unsigned char 2.1.3 signed short/unsigned short 2.1.4 signed int/unsigned int 2.1.5 signed long/unsigned long 2.1.6 ¯oat 2.1.7 sbit 2.1.8 sfr 2.1.9 sfr16 Memory Models Interrupts Structure of a Microcontroller-based C Program Program Description Language 2.5.1 START-END 2.5.2 Sequencing 2.5.3 IF-THEN-ELSE-ENDIF

vi

Microcontroller Projects in C for the 8051

2.6 2.7

2.5.4 DO-ENDO2.5.5 REPEAT-UNTIL Internet Web Sites of Microcontroller Compilers Further Reading Light Projects 1 ± LED Binary Counter 2 ± LED Chasing Circuit 3 ± Random LED Pattern 4 ± Cyclic LED Pattern 5 ± LED Dice 6 ± Hexadecimal Display 7 ± Two-digit Decimal Count 8 ± TIL311 Dice 9 ± 7 Segment Display Driver 10 ± Four-digit LED Display Interface 11 ± Interrupt Driven Event Counter with 4-digit LED DisplaySound Projects

24 25 25 27 29 29 33 34 37 38 46 50 53 57 62 75 85 86 90 94 95 101 107 108 119 125 126 132 147 151 155 161 167 171 177

Chapter 3 PROJECT PROJECT PROJECT PROJECT PROJECT PROJECT PROJECT PROJECT PROJECT PROJECT PROJECT Chapter 4

PROJECT 12 ± Simple Buzzer Interface PROJECT 13 ± Small Speaker Interface (Using the Timer Interrupt) PROJECT 14 ± Two-tone Small Speaker Interface(Using the Timer Interrupt) PROJECT 15 ± Electronic Siren (Using the Timer Interrupt) PROJECT 16 ± Electronic Siren (Using the Timer Interrupt) Chapter 5 Temperature Projects PROJECT 17 ± Using a Digital Temperature Sensor PROJECT 18 ± Digital Thermometer with Centigrade/Fahrenheit Output PROJECT 19 ± Digital Thermometer with High Alarm Output PROJECT 20 ± Digital Thermometer with High and LowAlarm Outputs PROJECT 21 ± Using Analogue Temperature Sensor IC with A/D Converter Chapter 6 RS232 Serial Communication Projects PROJECT 22 ± Output a Simple Text Message from the RS232 Port PROJECT 23 ± Input/Output Example Using the RS232 Port PROJECT 24 ± A Simple Calculator Program Using the RS232 Port Appendix ± ASCII code GLOSSARY Index

Preface

A microcontroller is a single chip...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • proyeto
  • Proyetos
  • Proyeto
  • Proyeto
  • Ante proyeto
  • Proyeto
  • proyeto
  • proyet

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS