PWM option
An alternative solution to using an on-chip SSG block for synchronized clocking and sampling involves using one or more PWM channels, which are readily available on most 32-bit MCUs. While a PWM-controlled output offers the essential clocking features necessary for CCD operation, the SSG block provides some significant advantages.
When a CCD receives a clock pulse, the device initiates a voltage level output to be captured by an ADC. However, the output of the anticipated voltage never appears immediately after the clock edge. Instead, most CCDs begin by outputting a signal representing optical black before the signal settles to the voltage describing the pixel state.
The ADC’s start-of-conversion process must be delayed until the CCD’s analog output has settled. MCUs that enable hardware configuration to control that timing offset before the conversion begins are available. When using a PWM, firmware is responsible for delaying the start of conversion, potentially by using a timer module or another PCA channel. Timing jitter introduced by firmware intervention in such a system can result in sample inaccuracies and lead to incorrect or unreliable barcode decoding.
Many barcode scanning designs also require the clocking signal pins to hold their state under certain circumstances. In most systems with PWM output, this holding state requires removing the PWM from the pin followed by configuring the pin for general-purpose use. During the brief period that PWM control is swapped out for general-purpose control, the pin state can be indeterminate, resulting in an output of runt pulses or other unintended signals that can cause the MCU to lose synchronization with the CCD.
An on-chip SSG block can provide direct control over its output pin states, enabling firmware to switch from a hardware block-controlled port pin state to a manually controlled state without the transitional indeterminate pin state.
Managing multiple supplies
A system in which devices are powered by both 3v- and 5V-logic traditionally requires that level shifting or some other type of glue logic be placed on interfacing signal traces. In addition, these systems can require separate, discrete voltage regulators to supply 3V or 5V where appropriate. Choosing an MCU with an integrated voltage regulator and adjustable port-drive levels eliminates the need for this external circuitry.
USB and other communications alternatives
Most scanners transmit decoded barcode information to a host system across a USB port. Unfortunately, demanding USB timing requirements force many designs to use an external high-precision crystal as a time base, which adds to BOM, increases board size, and can cause reliability issues. One way to eliminate this need is by employing an MCU with an on-chip clock-recovery mechanism that generates an internal USB clock compliant with full-speed USB timing specs, without an external crystal.
Systems that communicate with a host that’s not USB-enabled can communicate information across one of the other common serial interfaces, such as UART, USART, SPI, and I2C.
Audio output
Many barcode scanners provide some form of audible feedback. For instance, the device might beep when the user presses a button to initiate a scan, or it may audibly indicate a successful scan. Traditionally, implementing this feature has required the MCU to connect to a DAC or use a simple PWM to activate a buzzer. Some MCUs integrate a flexible, high-precision PWM that can interface with Class D amplifiers, which are more power-efficient and require a smaller PCB footprint, and whose components cost less than many other audio output solutions.
&mdashParker Dorris is a senior applications engineer supporting Silicon Labs’ microcontroller product line.
Related posts: