Practical AVR Microcontrollers

Author: Alan Trevennor
Publisher: Apress
Pages: 386
ISBN: 978-1430244462
Audience: Hardware programmers who want to do things the difficult but cheap way
Rating: 4
Reviewer: Harry Fairhead

Working with a raw AVR micro is difficult, but is it worth the effort. This book goes deeper than you might expect.

The subtitle of this book is: "Games, Gadgets, and Home Automation with the Microcontroller Used in the Arduino"  and you really need to take notice of the "Used in the Arduino". This is basically a book on using the AVR chip that is at the heart of the Arduino using the Arduino software, but not its prepackaged hardware. What are you missing out on by not using the full Arduino is a certain amount of convenience. What you gain is flexibility and reduced cost.

Put simply working with a raw AVR is harder than playing with an Arduino.

 

 

The first chapter is a history of microcontrollers and it is basically an "in praise of RISC" and you can skip it if you want to. Chapters 2 and 3 detail how to get the Arduino software working with a raw AVR chip. To do this you have to first implement a programmer that lets you connect the chip to a PC via a USB connector. Every Arduino has a programmer built in, but you really only need one to program the chip not to make use of it. Chapter 3 then goes on to explain how to get the AVR plus programmer working with the Arduino software. Right at the start of hte chapter is a really interesting comparison of using an AVR or a 555 to flash and LED. With one LED the complexity is about the same but you can't help but feel uncomfortable about using such a complex device to do the job of a simple 555. The later example, however, soon demonstrates the power of the AVR approach as you get to flash increasing numbers of LEDs.

 

Banner

 

By the end of chapter 3 you have a basic AVR setup and interfaced with the Arduino software and you can start to program it. Chapter 4 considers how to use it to make things move starting off with basic servo theory. Then we have the first project - a gem light - basically using a servo to move a light so as to show something crystalline off to best effect. This may seem like a silly application, but why not - one servo, one LED and one raw AVR chip are cheap enough to make it all reasonable?

From servos the chapter moves on to using transistors to switch loads including relays, lamps, solenoids, DC motors and stepper motors. Finally we look at sensors - switches, opto isolators, PIR sensors, reflective sensors and accelerometers. This chapter is a crash course in what you need to know to connect the AVR to the outside world. 

From this point on the book starts to move into the area of software and how it can enhance the basic hardware. Chapter 5 is called "Smarten Up"" and it explains how you can make use of the intelligence of the AVR and its software. The first example is implementing an intelligent light complete with proximity senor. Chapter 6 is about communications.

This brings us to Part 2 of the book which is all about projects.
The first is a secret panel of the sort you might use to hide something valuable that opens using a motor drive. Project 2 is a pair of servo mounted lasers - not to zap things but to keep a pet amused. Project 3 is a game involving a 4x20 LCD. Project 4 is a lighting waterfall which uses LEDs to create interesting light shows. Finally Project 5 is another game - duck shoot using LEDs and shadow puppets.

The final chapter is about the smart home. This is mostly a theoretical discussion, but towards the end you get a radio controlled light stand project. The book rounds off with some appendixes on digital electronics, using breadboards and serial comms.

This is not a book for the beginner, mostly because the approach to the same ideas and technique via the Arduino is a lot easier. With the Arduino you don't have to get involved in such low-level construction because most things are available off the shelf in the form of pre-built shields. It is more expensive but it is also more productive if you are learning.  All of the projects covered in the second half of the book could be more easily implemented using Arduino hardware - but they would be more expensive.

As long as you are reasonably competent, then the raw AVR approach is interesting and illuminating. You get to find out how the parts of a project work at a component level, rather than at module level. And, of course, the components are cheap enough for you not to need to reuse them for your next project. I enjoyed reading this book and it gave me the confidence to that I would be able to convert one of my Arduino projects into a "production" AVR implementation with no real practical problems. It is a good book for the right reader and a good longer term resource.

 

Banner


Machines Like Me

Author: Ian McEwan
Publisher: Vintage, 2019
Pages: 304
ISBN: 978-1529111255
Print: 1529111250
Kindle: B07HR6SGQ9
Audience: General
Rating: 4.5
Reviewer: Mike James
A novel about a synthetic human has become so much more relevant recently and guess what - it features Alan Turing.



Driving Value With Sprint Goals

Author: Maarten Dalmijn
Publisher: Addison-Wesley
Pages: 256
ISBN: 9780137381920
Print: 0137381921
Kindle:B0C7ZJR7N2
Audience: Scrum developers
Rating: 5
Reviewer: Kay Ewbank

Over the years I've read a lot of books about agile development and Scrum, and most concentrate on the methodology rather tha [ ... ]


More Reviews

Last Updated ( Saturday, 26 January 2013 )