Analog Output
Abstract
This chapter starts by reviewing the main features of digital-to-analog conversion, with consideration given to the number of bits in the conversion, resolution, and the role of the voltage reference. The mbed digital-to-analog converter is introduced, and simple DC and saw tooth outputs generated. A sine wave is generated using the sine function from the math.h standard C library. The main concepts of pulse width modulation (PWM) are then introduced, followed by a consideration of the mbed PWM capability. PWM outputs are generated in a series of programs, for motor control, servo positioning, and audio tone generation. PWM is also generated in a software loop, demonstrating that dedicated hardware is not essential. ...
Get Fast and Effective Embedded Systems Design, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.