Developing in C for the ATmega328P: A Second Serial Port

UPDATED Where I discuss in detail, adding a second serial port to the Uno, soft_serial, and how to use it. New soft serial port has been rewritten in AVR assembly providing much higher speeds.

Introduction#

While I was developing code for a robotic arm, I realized it would be best, if I used one serial port for communicating with the arm and another serial port to accept commands for the arm. Thus I created a second serial port, called soft_serial.

Developing in C for the ATmega328P: Better Serial Input

Where I discuss how to improve on the serial input of C and the ATmega328P and adding a second serial port, soft_serial.

Introduction#

In the example serialio_string (code on GitHub or below), I demonstrate the problem with reading text from the serial port. If you use scanf(), it appears to work well, except you can easily over-run the buffer. For example, the program asks for “up to 7 char”, however, it will accept as many as you are willing to type. More than likely, after about 20 characters, the microcontroller will crash.

Embedded Ada on an AVR Microcontroller: Introduction

Where I begin to explore using Ada on an Arduino Uno.

Introduction#

On the Adafruit site, I ran across a mention of an award as to an “Ada Crate on an AVR” microcontroller. Which I found fascinating. Ada is a language developed for larger computers and wasn’t something I would expect to fit on to the AVR-series of microcontrollers.

This led me down a path of attempting to understand:

  1. What is Ada as it relates to microcontrollers?
  2. Is there value to using Ada on a microcontroller as compared to C?
  3. How do I do so?

This post describes my journey and how to begin to develop in Ada on an Arduino Uno or AVR ATmega328P