O'Reilly logo

Embedded C Programming by Mark Siegesmund

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16

Discrete Input and Output

Abstract

This chapter teaches the reader how to perform basic level-based digital I/O from C on a microcontroller. This essentially is setting an output pin to a high or low state or reading the state of an input pin.

In addition to the functions needed in C, some basic electronic concepts are covered such as voltages and drive current. Debouncing and filtering inputs are shown, with code examples and diagrams. TTL, Schmitt trigger, and open collector I/O pins are all described. An example is also included that shows mapping an entire I/O port to a C structure.

Examples and exercises are for the popular PIC® microcontroller manufactured by Microchip.

Keywords

Discrete I/O

Debouncing

Filtering

TTL

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required