A standard peripherals approach to adding flexibility to 32-bit MCU designs

Today’s 32-bit microcontroller (MCU) designs integrate a wide variety of standard peripherals, such as analog-to-digital converters (ADCs), digital-to-analog converters (DACs), universal synchronous/asynchronous transmitters (USARTs) and timers.

While this peripheral integration is intended to address a wide range of general-purpose applications, embedded developers commonly consider these on-chip peripherals to be “check box” items, and the implementation of this peripheral integration usually ends up providing limited value.

In addition, the lack of smart interconnectivity among peripherals often forces designers to add significant amounts of glue logic to ensure proper use of the MCU’s features, resulting in unnecessary incremental development costs and system complexity.

Standard MCU peripherals are intended to support a broad range of general-purpose embedded applications. However, peripherals often are integrated into 32-bit MCU designs with little or no thought about how they can enable a more cost-effective or simpler application implementation.

Let’s take a closer look at implementations of standard MCU peripherals that provide system-level value and application benefits that help designers get the most out of every feature in the MCU while simultaneously reducing the bill of materials (BOM) and simplifying the embedded design.

Innovative implementations of standard MCU peripherals, such as I/O with deterministic pulse generation and level shifters, USART input noise-filtering for reliable communications, capacitive-sense tamper detection systems, current-based communication using interconnecting digital-to-analog converters (IDACs) and synchronous current-to-voltage converter systems, can provide significant value for 32-bit embedded designs.

I/O with deterministic Pulse Generation and Level Shifters
Some 32-bit applications require the generation of one or more pulses with precisely-controlled pulse widths.

Examples include a trigger for an external event or a test pulse to stimulate an external device within a specific time window. A typical software-implemented I/O toggle cannot guarantee the pulse width since the software is subject to interruptions and latencies, and using a timer consumes a valuable and typically pin-constrained resource.

An innovative solution to this design challenge implements pulse generation at the I/O level (Figure 1 below ). This system provides the capability to set the initial and final value of the I/O in one 32-bit register (allowing the initial and final value to be set in a single 32-bit word write) along with a mask register to enable multiple pins at any time and a programmable 5-bit delay time.


Click on image to enlarge.
Figure 1. Pulse Generation Register Implementation

Once initiated, the pulse generator waits for a number of peripheral clock cycles set by the delay time before driving the pre-programmed final value onto the I/O pin, enabling simple yet effective deterministic pulse generation. Figure 1 above shows a practical implementation of this feature at the register level.

3 V-to-5 V level shifting
Another common challenge in factory automation and industrial control applications is interfacing with legacy 5 V I/O systems. While a 5 V-tolerant I/O provides a means of receiving input from 5 V outputs, bidirectional communication requires the capability to drive 5 V logic levels. To address this problem, system designers are often forced to add external glue logic, such as external level shifters, increasing PCB layout complexity and BOM cost.

An integrated, versatile level shifting system can be achieved by enabling a 3 V I/O and a 5 V drive I/O that are directly interconnected on the same device, thus enabling a 3 to 5 V level shifting capability. This connectivity enables the developer to connect any output peripheral that does not already go to the 5 V drivers through an external wire that can be converted to a 5 V driver.

Figure 2 below provides an example in which a timer output that is typically in a 3 V domain can be level shifted by externally connecting the timer output to one input of the 3 V I/Os that are internally connected with the 5 V drive. The output of the corresponding 5 V drive output provides a 5 V timer output.


Clickon image to enlarge.

Figure 2. Internal Level Shifter System

Current-based communications using IDACs
Applications developed to support noisy environments, such as factory floors, face the major challenge of providing reliable communications in the presence of high noise levels. Typical communications interfaces, such as USART, SPI and I2C, have proven to offer some level of reliability. However, these applications are always pushed to their limits. One solution is to implement current-based communications using IDACs to enable communications protocols with high levels of noise immunity.

To implement this solution, the developer must use a current-mode IDAC. While a typical DAC provides a voltage output through a current output, an IDAC is controlled by a smart timer that can assist in generating the timing sequence for the communications protocol. In addition, a FIFO buffer on the IDAC can generate an interrupt after the FIFO has sent the last word of data, allowing the software to load the FIFO with the next packet of data to be sent, as shown in Figure 3 below.


Clickon image to enlarge.

Figure 3. Current-Based Communications Using IDACs

Input filter for noisy communications
In a typical industrial context, it is relatively common to find communication channels affected by noise. For example, a USART is a typical interface that can be impacted by a noisy environment and thus benefits from a comparator threshold filter used to filter noise from the receiver (RX) path.

To implement this system, it is necessary to use a comparator with an N-bit DAC acting as a voltage reference on the negative input. If the device containing this comparator is used in a noisy environment and it has to detect a noisy USART RX signal, the comparator can be used as an RX filter to remove the noise and avoid bad USART data.

The USART RX signal coming from the slave device will connect to the selected comparator positive input pin. The N-bit DAC can be used to threshold filter the RX signal, given prior knowledge of the noise in the system. The comparator’s asynchronous output is then sent from the device back into the actual USART RX input.

This input filter technique is not limited to a USART RX channel. The same technique can be used on any noisy input signal. Figure 4 below provides a flow diagram of the signal path to enable a filter mechanism for a UART implementation.


Clickon image to enlarge.

Figure 4. Comparator-as-Filter USART Receiver

Capacitive touch for tamper detection
Many 32-bit MCU-based systems used in industrial control or home automation require some level of tamper detection. For example, security cameras use detection of a known number of consecutive dark images as a tamper detection trigger. Other techniques might use external sensors to generate a tamper trigger event. Most 32-bit MCUs have fixed input pins that are either active high or active low and float or switch polarity to indicate a tamper event.

An alternative solution uses a capacitive touch-sense engine as a potential multi-channel tamper detection system. For example, the capacitive touch-sense engine built into Silicon Labs’ ARM-based Precision32® MCUs supports channel bonding and has a maximum of 16 possible input channels supporting up to 16 tamper detection channels in a single conversion.

Alternately, using a non-channel-bonded mode combined with a programmable threshold, 16 tamper detection channels with independent tamper thresholds on each channel can be implemented with minimal software overhead. This engine can be used to generate a time stamp via an interrupt to the system generating a real-time clock (RTC) trigger event.

A typical untampered system can be implemented with tamper detect channels that have a known capacitance, which will be detected. For example, if the capacitive touch-sense node is connected to a closed door monitored by a security system, you would expect the capacitance to be “X” pico farads (pf).

If the door is opened, the capacitance will be “less than X” pf. In this scenario, the capacitive touch-sense module can be configured to generate an interrupt that then triggers the system to time-stamp the event in software by reading the RTC timer register at this time. There will be a few cycles of latency, but given the frequency of the RTC and the operating frequency of the system, the human scale timing of this event will, for all intents and purposes, look like a zero-time event.

The capacitive touch-sense module also supports a “greater than threshold” event trigger, so the opposite of the “closed door” system can also be implemented (i.e., an “open door” system). Given the multi-sampling capability of the capacitive touch-sense module, multiple samples can be taken and accumulated to filter out false triggers.

The capacitive touch-sense capability can also function in sleep mode to enable a low-power system. This can be accomplished by setting up the RTC to trigger a certain number of times per second, wake up the system and perform a capacitive touch-sense port scan. Depending on whether a tamper event was detected or not, the system will either continue with post-tamper-related functions or go back to sleep.

Synchronous current to voltage converter systems
Many sensors used in factory automation, building control and medical applications, such as pressure sensors, optical sensors, transducers and biosensors, provide a current output instead of a voltage output to achieve greater noise immunity.

To properly interface with current output sensors, the design must include a current-to-voltage converter. Typically, an external current sensing system is added to the system, resulting in greater BOM cost, design complexity and challenges in synchronizing measurements based on dynamic excitation references.

For example, a biosensor used in a medical glucose meter, outputs tiny current values as a result of a dynamic excitation. A cost-effective implementation of a biosensor interface that requires full synchronization between dynamic excitation and current measurements can be achieved using a synchronized DAC-ADC mechanism.

Precision32 MCUs, for example, support this synchronization capability. In addition to providing a full synchronization path between the ADC and DAC, Precision32 MCUs also feature an internal current-to-voltage converter.

Figure 5 below illustrates the DAC-ADC synchronization mechanism using the current-to-voltage converter. The sample synchronization generator module can generate a synchronous pulse to trigger both the DAC and ADC conversion inputs.


Clickon image to enlarge.
Figure 5. DAC and ADC Synchronization Based on Current-to-Voltage Converter

The ADC can be configured to either sample synchronously with the DAC output or in a delayed fashion by a fixed number of clock cycles to allow the sensor to process the stimulus input. This enables a fully synchronous measurement system, simplifying the system design and reducing cost by eliminating external components.

Conclusion
Innovative implementation of standard 32-bit MCU peripherals coupled with a highly flexible interconnect architecture enables a wide variety of configurations for embedded systems. The synchronous current-to-voltage converter, input filter for noisy communication and 3 to 5 V level shifting are examples of flexible interconnect architectures.

Using versatile I/Os and peripherals, such as capacitive touch, I/O pulse generation and DAC precision enhancement, developers can achieve novel solutions to real-world embedded design problems while reducing cost, simplifying design and accelerating time to market.

Thomas David is a principal design engineer for Silicon Labs ’ MCU products and was the lead designer for the company’s first 32-bit MCU product, the SiM3U16X Precision32 MCU. He has been involved, either as a designer or as a chip lead, in nearly all of the MCU products released by Silicon Labs. He came to Silicon Labs as part of the company’s Cygnal Integrated Products acquisition in 2003. Prior to Cygnal, he was president of Silogix, an Austin-based silicon intellectual property (SIP) company that was acquired by Cygnal Integrated Products. He a BSEE from Purdue University and an MSEE from Penn State University.

Pedro Pachuca manages Silicon Labs’ global microcontroller (MCU) interface product business. He joined Silicon Labs in early 2010. Previously, he was a product marketing manager at Freescale Semiconductor where he developed MCU business strategies to penetrate new global markets and managed a business with an annual run rate in excess of $250 million. Mr. Pachuca holds a BSSE degree from the Instituto Politecnico Nacional at Mexico City.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.