Design Idea
Microcontroller provides low-cost analog-to-digital conversion, drives seven-segment displays
Versatile conversion circuit detects and displays signal's peak value.
Name withheld by author’s request; Edited by Charles H Small and Fran Granville -- EDN, 5/10/2007
A previous Design Idea demonstrated how to use shift registers to increase a microcontroller’s output capabilities (Reference 1). This expanded Design Idea provides low-cost analog-to-digital conversion and a three-digit, seven-segment display. Although applicable to other microcontrollers, the circuit in Figure 1 uses a Microchip PIC12F675 controller and three multiply sourced 74AC164 serial-input/parallel-output shift registers.
The circuit accepts incoming signals of 0 to 5V. The microcontroller, IC1, performs the analog-to-digital conversion and subsequently converts the binary-voltage value to BCD (binary-coded-decimal) format. Next, the microcontroller converts the BCD values to hardware-specific seven-segment-display masks and shifts the masks to the 74AC164 registers, IC2 through IC4, which in turn drive the seven-segment displays.
Listing 1 implements an additional function. Instead of displaying each input value as it’s converted, the microcontroller operates as a peak detector. When the maximum value changes, the microcontroller updates the three-digit display. A pushbutton switch, S1, resets the maximum value. You can modify the code to apply other functions to the input data and calculate and display the data in other formats. In addition, you can modify the interrupt-driven conversion process to accommodate different sampling rates. When you modify the sampling rate or the ISR (interrupt-service routine), ensure that the ISR completes execution within a single sample period.
| Reference |
|
















