Microcontrollers in Practice

Chapter 12: Digital Voltmeter with RS232 Interface

12.1 In this Chapter

This chapter contains a didactic example on how to use the AVR development board described in Chap. 10 as an 8-channel digital voltmeter that can be interrogated over the RS232 interface. The characters received from the serial line are interpreted as the address of the analog channel to be read and reported.

12.2 The Hardware

The voltage levels expected by the A/D converter are in the range [0, V ref] and V ref is connected to V cc. The analog inputs are presented as positive voltage signals to the connector X100, pins 1 8, referred to the ground line X100-9, then filtered by the RC filters implemented by R11 R26 and C11 C19, and applied to the analog inputs ADC0 ADC7 of the MCU.

The output of the ADC system, corresponding to V in is a 10-bit binary value:

(12.1)

Since V ref = V cc = +5 V, an input voltage V in = 3.1 V, for example, is converted to decimal 634, which corresponds to the hexadecimal value $27A.

The example presented in this chapter uses only the serial communication interface RS232 to report the values read by the ADC, but optionally a local display, like the one presented in Appendix A14, can be connected to the board on the synchronous peripheral interface SPI.

12.3 The Software

The software application is structured according to the principles described in Chap. 10. After the initialization sequence, the program enters an infinite loop,...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Bit Error Rate Testers
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.