Generate a squarewave on PA5 whose period is controlled by a
Generate a square-wave on PA5 whose period is controlled by an analog voltage signal (that varies between 0 and 5 Volts) applied to PE7. The period of the signal is determined by T=1000+8*(ADR1+PORTCL). The HC11 must be in a “BRA *” loop as the wave is being generated/controlled (i.e., interrupts must be used). The square wave signal period should change whenever the analog voltage changes or after a rising edge is received on the STRA pin. Assume VRL=0 and VRH=5.
Solution
A)Even when the ADC is available on-chip with an MCU where the unpleasant task of interfacing and debugging the ADC-to-CPU interface is done, obtaining maximum performance from the ADC requires attention to application details of the given MCU/ADC combination. The type of design precautions and applications details needed to avoid problems varies as a function of the type of ADC used. Understanding the mechanics of the given ADC is crucial to improving performance.
ADCs may be categorized into five main categories. Although each type has unique capabilities and traits, each has surprisingly similar points of vulnerability. The categories are:
• Integrating • Servo
• FLASH
• Successive-approximation converter (SAC)
• Hybrid
The integrating converter has appeal for applications requiring high resolution (16-bit or higher) and low cost. Because the basic converter is simply implemented hardware is minimized while high resolution is obtained. In addition, the integrating ADC may provide some noise immunity that is not feasible with higher speed designs. Although it is possible to build the integrating converter onto MCU chips (there is nothing technologically impeding such a construct), its lower speed has apparently been discouraged by MCU designers since it is currently not offered on an MCU by a major manufacturer. Whereas the integrating converter tends to be the slowest of ADC types, the servo converter tends to have the highest resolution and fastest conversion times in its most recent advancement — the sigma-delta converter. The more traditional servo converter tries to balance the charge or voltage on an input comparator by using a feedback to force slewing from a previous charge or voltage to the current input signal level applied to the other input of the same comparator. This process is followed by appropriately changing a digital counter up or down (in this form, the converter is often called a tracking converter). Before the sigma-delta variation, the servo converter was less popular than other converter types primarily due to its slew rate limitation. Nothing about the servo converter would prevent its inclusion onto an MCU die; once BiCMOS processes improve, this converter type will probably become a popular feature of future MCUs (particularly the sigma-delta variation, most of which is linear circuitry).
Although the sigma-delta variation of the servo converter provides highresolution conversions and maintains a relatively high throughput rate, the fastest type is the FLASH converter. By stringing together several voltage comparators (one per desired level to be detected), conversion bandwidths in excess of 100 MHz are now quite commonplace Although the sigma-delta variation of the servo converter provides highresolution conversions and maintains a relatively high throughput rate, the fastest type is the FLASH converter. By stringing together several voltage comparators (one per desired level to be detected), conversion bandwidths in excess of 100 MHz are now quite commonplace.
This popularity is primarily due to its applicability to smaller circuit requirements, medium-to-fast conversion speeds, and the medium- to high-resolution applications (8 to 16 bits). Like other converter types, the SAC uses a differential voltage comparator to compare the input signal with a reference voltage. By performing a binary search, conversion rates of one bit per clock are possible. Because only one comparator is typically required and the output code is inherent in the conversion process, circuitry and silicon surface area are reduced when compared with other conversion methods. Although the exact implementation varies from silicon-chromium-based to chargeredistribution, this ADC is currently the most prevalent type found on MCUs. The fifth ADC category is the hybrid converter. In this case, the term hybrid is not used to reference a specific implementation approach, but rather implies combining one or more ADC types to form an ADC with different performance characteristics.
