Giter Site home page Giter Site logo

christopher-mcclellan-embedded-101's Introduction

Summary

Over the last year, I've been asked the same question over and over again.

How do I get started with embedded software development?

I usually tell people to go buy an Arduino, throw away the Arduino IDE and libraries, and figure out how to blink a light using just the AVR toolchain.
This "book" is designed to teach you how to do exactly that, and then move on to the other basics of embedded software dev that you need to know to start your journey.

Prerequisites

As an introduction, this "course" requires no prior knowledge of embedded software, C, or C++, or electronics, but does assume a general knowledge of programming in general.

Hardware

For this course, we'll use an Arduino Uno because of its ubiquity and availability. Feel free to purchase a clone, personally, I like the SparkFun Redboard, but many different Uno clones are available for as little as $10. You'll also need a small breadboard, some jumpers, leds, resistors, capacitors, buttons, and other odds and ends to get the most out of this.
I recommend something like Adafruit's Parts Pal kit or SparkFun's Beginners Parts Kit and Half Sized Breadboard.
We're not going to cover electronics at any depth, but we will need to wire up a few simple circuits.

Software

For my own projects, I've developed a Docker image for AVR development.
It contains the AVR toolchain and relevant software you'll need.

If you're running Linux, you need no additional setup, beyond some configuration files to tell avrdude and minicom which serial port your board is attached to.

Using the docker image on Mac

For reasons you can read about on my blog if you care, connecting a docker container to USB ports on Mac requires a bit more software and setup.

  • Download and Install VirtualBox 6.06 or greater.
    • You MUST have version 6.06 or greater, there was a bug in earlier versions that cause this to fail.
  • Download and install the VirtualBox extension pack
  • Download and run the mac-setup-docker.sh script.
  • Setup your terminal by running eval $(docker-machine env)
    • You'll need to run this each time you create a new terminal, or add it to your profile.

Install tools on Mac via Homebrew

Sometimes the docker setup can be a bit flaky in regards to usb, so if you want to just install the tools, you can use Homebrew. Be advised that compiling & installing the compilers can take quite some time.

brew tap osx-cross/avr
brew install \
    avr-gcc \
    avrdude \
    minicom \
    cpputest \
    pkg-config \
    gcc

Table of Contents

  • Introduction: What is Embedded Software?
  • Hello World
  • Hello World Explained
  • Make
    • Basics
    • AVR Template
  • Offboard LED
    • Breadboards, LEDs, schematics, more datasheets
  • Interrupts (Turn light on/off with a push button)
    • Bouncing
    • Intro to Logic Analyzer
  • Timers
  • Unit Testing
  • Integration Testing
  • Pulse Width Modulation (PWM)
  • Analog Digital Conversion (ADC)
  • Serial Communications
    • UART
    • SPI
    • I2C
    • CAN
    • Modbus

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Addititionally, all code in this repository is licensed under the MIT license.

MIT License

Copyright (c) 2019 Christopher J. McClellan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.