Developing in C on the AVR ATmega328P

3 minute read

Introduction

While the Arduino IDE and software framework is outstanding for quickly developing a working prototype, it does so with a combination of the C++ language and Arduino-only objects. This can become an issue if you are at a college or university which expects standards-based C language proficiency. This set of entries for designed for learning how develop embedded ANSI C programs for the AVR family and specifically the ATmega328P (Arduino Uno).

Pages of Significant Interest

Course Material

Developing in C for the ATmega328P

Beginning tutorial using Labs_10C_Class content to help someone replace the Arduino C++ software framework with a Standard C approach.

  1. Developing in C for the ATmega328P: Notes
  2. Developing in C for the ATmega328P: Getting Started
  3. Developing in C for the ATmega328P: Setup Introduction
    1. Developing in C for the ATmega328P: Linux Setup
    2. Developing in C for the ATmega328P: macOS Setup
    3. Developing in C for the ATmega328P: Windows/WSL Setup
    4. Developing in C for the ATmega328P: Windows 10 Setup
  4. Developing in C for the ATmega328P: Using git
  5. Developing in C for the ATmega328P: Edit
  6. Developing in C for the ATmega328P: Build
  7. Developing in C for the ATmega328P: Upload
  8. Developing in C for the ATmega328P: AVR_C Library Functions
  9. Developing in C for the ATmega328P: Using a Serial Monitor
  10. Developing in C for the ATmega328P: Functions - Serial input/output
  11. Developing in C for the ATmega328P: Function - analogWrite()
  12. Developing in C for the ATmega328P: Functions - Serial input/output
  13. Developing in C for the ATmega328P: Function - digitalWrite()
  14. Developing in C for the ATmega328P: Function - pinMode()
  15. Developing in C for the ATmega328P: Function - digitalRead()
  16. Developing in C for the ATmega328P: Struct - buttons[]
  17. Developing in C for the ATmega328P: Function - analogRead()
  18. Developing in C for the ATmega328P: Hints
  19. Developing in C for the ATmega328P: Mapping Values
  20. Developing in C for the ATmega328P: Using Data Types and Math
  21. Developing in C for the ATmega328P: Marking Time and Measuring Time
  22. Developing in C for the ATmega328P: User Functions
  23. Developing in C for the ATmega328P: Multi-tasking the Arduino - Part 1
  24. Developing in C for the ATmega328P: Function - tone()
  25. Developing in C for the ATmega328P: Using PROGMEM
  26. Developing in C for the ATmega328P: structures
  27. Developing in C for the ATmega328P: Code vs. Cost
  28. Developing in C for the ATmega328P: Pointers
  29. Developing in C for the ATmega328P: Servos
  30. Developing in C for the ATmega328P: I/O Ports
  31. Developing in C for the ATmega328P: Make, Makefile and env.make

AVR Datasheet Notes

Technical tutorial using specific capabilities of the ATmega328P chip. This content is intended to help somone understand how to use the datasheet to implement a specific function using the ATmega328P.

  1. AVR Datasheet Note: Blink
  2. AVR Datasheet Note: PWM
  3. AVR Datasheet Note: analogWrite

Programming Examples

Intermediate tutorials focused on using the AVR-gcc library or examples from the library.

  1. AVR-gcc Note: Simple Project
  2. Using the Standard C Framework
  3. Writing Multitasking Programs
  4. Using Makefiles to Automate Development

Hardware Debugging

Technical tutorials on using Bloom, gdb, debugWIRE, a hardware debugger such as the Microchip SNAP or the one on the ATmega328PB Xplained Mini board to debug programs on the microcontroller.

  1. Hardware Debug: Using gdb to debug
  2. Hardware Debug: Setup Bloom and gdb to Debug
  3. Hardware Debug: Examples of Bloom with gdb to Debug
  4. Hardware Debug: Hints on Solving Issues Bloom and gdb
  5. Hardware Debug: Exploring the ATmega328PB Xplained Mini
  6. Hardware Debug: Command and Configuration Reference for Bloom and gdb

Reference Content on C

Reference books which are important for understanding C

  1. The C Programming Language Kernighan and Ritchie - available in PDF and paper copy
  2. Barr Group: Embedded C Coding Standard
  3. SEI CERT C Coding Standard
  4. Arduino Resources page
  5. comp.lang.c FAQ

Comments powered by Talkyard.