
External
Embedded Controllers Using C and Arduino
This text is designed to introduce and expand upon material related to the C programming language and embedded controllers, and specifically, the Arduino development system and associated Atmel ATmega microcontrollers. It is intended to fit the time constraints of a typical 3 to 4 credit hour course for electrical engineering technology and computer engineering technology programs, although it could also fit the needs of a hardware-oriented course in computer science.
- Author
- James M. Fiore
- Publisher
- Mohawk Valley Community College
- Source
- LibreTexts
- License
- CC BY-NC-SA
- Language
- EN
Contents· 135 sections
- 1: Course Introduction
- 1.1: Overview
- 1.2: Frequently Asked Questions
- 2: C Memory Organization
- 2.1: Introduction
- 2.2: Guts 101
- 2.3: Memory Maps
- 2.4: Stacks
- 3: C Language Basics
- 3.1: Introduction
- 3.2: Variable Naming Types and Declaration
- 3.3: Functions
- 3.4: Libraries
- 3.5: Some Simple Math
- 3.6: The Program Creation Development Cycle
- 3.7: Summary
- 3.8: Exercises
- 4: C Basics II
- 4.1: Input and Output
- 4.2: Variable Sizes
- 4.3: More Math
- 4.4: Bitwise Operations
- 4.5: Setting Clearing and Reading Register Bits
- 4.6: define
- 4.7: Keywords
- 4.8: Exercises
- 5: C Storage Types and Scope
- 5.1: Types
- 5.2: Scope
- 5.3: Exercises
- 6: C Arrays and Strings
- 6.1: Introduction
- 6.2: String Manipulation
- 6.3: Exercises
- 7: C Conditionals and Looping
- 7.1: Conditionals
- 7.2: Nesting
- 7.3: Looping
- 7.4: While or For
- 7.5: Exercises
- 8: C Pointers and Addresses
- 8.1: Introduction
- 8.2: Using Addresses and Pointers
- 8.3: Pointer Dereferencing
- 8.4: Pointer Math
- 8.5: Pointers and Arrays
- 8.6: Exercises
- 9: C Look-up Tables
- 9.1: Introduction
- 9.2: Yes Id Like a Table for 360 Please
- 9.3: Waving Quickly
- 9.4: Error Correction via Table Translation
- 10: C Structures
- 10.1: Introduction
- 10.2: Pointers and Structures
- 10.3: Structures Arrays and So On
- 10.4: Exercises
- 11: C Linked Lists
- 11.1: Introduction
- 11.2: Linked List Example
- 11.3: Exercise
- 12: C Memory
- 12.1: Introduction
- 12.2: Free Memory Pool
- 12.3: Allocating Memory
- 12.4: Using Memory
- 12.5: Freeing Memory
- 12.6: Operating System Specific Routines
- 12.7: Exercises
- 13: C File IO
- 13.1: Introduction
- 14: C Command Line Args and More
- 14.1: Command Line Arguments
- 14.2: Conditional Compilation
- 14.3: Exercise
- 15: Embedded Programming
- 15.1: Introduction
- 15.2: Input Output
- 15.3: Math
- 15.4: Memory and Hardware
- 15.5: Code Development
- 16: Hardware Architecture
- 16.1: Introduction
- 16.2: Atmel AVR Core
- 16.3: Memory
- 17: AVR ATmega 328P Overview
- 17.1: AVR ATmega 328P Overview
- 18: Bits and Pieces include and define
- 18.1: Introduction
- 18.2: Universal Stuff Common to All Controllers
- 18.3: Controller Specific Stuff
- 19: Bits and Pieces Digital Output Circuitry
- 19.1: Introduction
- 19.2: Output Circuitry
- 20: Bits and Pieces Digital Input Circuitry
- 20.1: Introduction
- 20.2: Input Circuitry
- 21: Bits and Pieces pinMode()
- 21.1: pinMode()
- 22: Bits and Pieces digitalWrite()
- 22.1: digitalWrite()
- 23: Bits and Pieces delay()
- 23.1: delay()
- 24: Bits and Pieces digitalRead()
- 24.1: Introduction
- 24.2: A Practical Example Round-Robin Switch
- 24.3: Exercise
- 25: Bits and Pieces Analog Input Circuitry
- 25.1: Introduction
- 25.2: ATmega ADC system
- 26: Bits and Pieces analogRead()
- 26.1: Introduction
- 26.2: A Practical Example Mapping a Sensor
- 26.3: Exercise
- 27: Bits and Pieces analogWrite()
- 27.1: analogWrite()
- 28: Bits and Pieces Timer Counters
- 28.1: Introduction
- 28.2: Normal Mode
- 28.3: Fast PWM Mode
- 29: Bits and Pieces Interrupts
- 29.1: Introduction
- 29.2: External Interrupts
- 29.3: Internal Interrupts Blinking LED
- 29.4: Internal Interrupts Hand Wrought PWM
- 29.5: Internal Interrupts CTC Mode
- 30: Appendix A
- 30.1: ATmega 328P Register Map
- 31: Appendix B Answers to Selected Problems
- 31.1: Chapter 3
- 31.2: Chapter 4
- 31.3: Chapter 7
- 31.4: Chapter 8
- 31.5: Chapter 10
- 31.6: Chapter 12