ebook img

AVR Workshop: A Hands-On Introduction with 60 Projects PDF

548 Pages·2022·51.099 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview AVR Workshop: A Hands-On Introduction with 60 Projects

AVR WORKSHOP AVR WORKSHOP A Hands-on Introduction with 60 Projects by John Boxall San Francisco AVR WORKSHOP. Copyright © 2023 by John Boxall. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. First printing 26 25 24 23 22 1 2 3 4 5 ISBN-13: 978-1-7185-0258-1 (print) ISBN-13: 978-1-7185-0259-8 (ebook) Publisher: William Pollock Managing Editor: Jill Franklin Production Manager: Rachel Monaghan Developmental Editor: Abigail Schott-Rosenfield Production Editor: Rachel Monaghan Cover and Interior Design: Octopod Studios Technical Reviewer: Xander Soldaat Copyeditor: Rachel Head Production Services: Scribe Inc. For information on distribution, bulk sales, corporate sales, or translations, please contact No Starch Press, Inc. directly at [email protected] or: No Starch Press, Inc. 245 8th Street, San Francisco, CA 94103 phone: 1.415.863.9900 www.nostarch.com Library of Congress Control Number 2022020563 No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it. To Cyril, John, David, and all the people who enjoy making something out of nothing. About the Author John Boxall has been an electronics enthusiast for over 30 years, spending much of that time in the electronics retail, wholesale, and consulting fields. He also spent several years writing Arduino tutorials, projects, and reviews of kits and accessories at https://tronixstuff.com. Arduino Workshop (No Starch Press, 2013) was his first book. About the Technical Reviewer Xander Soldaat is a former Mindstorms Community Partner for LEGO® MINDSTORMS. He has a deep background in IT infrastructure architecture, as well as embedded systems, compiler, and STEM curriculum development. He is currently an OpenShift Cloud Success Architect at Red Hat. In his spare time he likes to tinker with robots, electronics, retro computers, and table-top games. BRIEF CONTENTS Acknowledgments Introduction Chapter 1: Getting Started Chapter 2: First Steps Chapter 3: Getting and Displaying Input Chapter 4: Communicating with the Outside World using the USART Chapter 5: Taking Control with Hardware Interrupts Chapter 6: Using Hardware Timers Chapter 7: Using Pulse-Width Modulation Chapter 8: Controlling Motors with Mosfets Chapter 9: Using the Internal EEPROM Chapter 10: Writing Your Own AVR Libraries Chapter 11: AVR and the SPI Bus Chapter 12: AVR and the I2C Bus Chapter 13: AVR and Character Liquid Crystal Displays Chapter 14: Controlling Servos Epilogue Index CONTENTS IN DETAIL Acknowledgments Introduction 1: Getting Started The Possibilities Are Endless The Microchip AVR Microcontrollers Required Parts and Accessories Electronic Components Choosing an AVR Programmer Required Software macOS 10.6 or Later Ubuntu Linux 20.04 LTS or Later Windows 7 Through 11 Current, Voltage, and Power Electronic Components Resistors Light-Emitting Diodes Power Diodes Capacitors Integrated Circuits Solderless Breadboards Powering Your Projects 2: First Steps Testing the Hardware and Toolchain Build the Circuit Connect and Run the Programmer What If It Didn’t Work? Project 0: Blinking an LED Uploading Your First AVR Code What If It Didn’t Work? Controlling Digital Outputs Hardware Registers Project 1: Experimenting with ATtiny85 Digital Outputs The Hardware The Code Using Schematic Diagrams Components in Schematics Wires in Schematics Dissecting a Schematic Project 2: Experimenting with ATmega328P-PU Digital Outputs The Hardware The Code Project 3: Bit-Shifting Digital Outputs Project 4: Experimenting with NOT Project 5: Experimenting with AND Project 6: Experimenting with OR Project 7: Experimenting with XOR 3: Getting and Displaying Input Digital Inputs Introducing the Pushbutton Reading the Status of Digital Input Pins Project 8: Blinking an LED on Command The Hardware The Code Making Decisions in Code if Statements if . . . else Statements Making Two or More Comparisons switch . . . case Statements Creating Your Own Functions Project 9: A Simple Custom Function Project 10: Custom Functions with Internal Variables Project 11: Custom Functions That Return Values Switch Bounce Protecting Your AVR from Fluctuating Voltages Pullup Resistors Pulldown Resistors

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.