Smart I/O offers flexibility for interconnection using the interconnection matrix. Users need not write any code to configure the Smart I/O block.
Applications of Smart I/O blocks
There are numerous applications that can use Smart I/O to reduce BOM, CPU loading, and device power consumption. The following examples demonstrate two such applications:
Using Smart I/O to implement logic elements – Smart IO LUTs can be used as general logic elements to build custom logic functions. Examples include logic gates, four-to-two priority encoders, shift registers, and glitch filters.
Figure 6 shows the implementation of a breathing LED by XOR-ing two PWM signals that have slightly different frequencies. Figure 7 shows how the Smart I/O in a PSoC 4 MCU can be used to implement the LED breathing effect. Here the XOR gate is implemented in the Smart I/O by configuring the LUT truth table as shown in Figure 8.
__Figure 6:__ *Implementing LED Breathing Effect using Logic Gates (Source: Cypress Semiconductor)*
__Figure 7:__ *Implementation of LED Breathing Effect using PSoC 4 Smart I/O (Source: Cypress Semiconductor)*
__Figure 8:__ *Implementing XOR gate using Smart I/O (Source: Cypress Semiconductor)*
Pattern Detection – Smart I/O LUTs can be configured to detect a particular pattern on the input signals (for example, logic to detect if three input signals are all low). Battery-operated embedded systems put the microcontroller into low power modes to reduce power consumption. When a specific event occurs, the CPU is woken up by an interrupt to process the event (Figure 9).
__Figure 9:__ *Low-power embedded application (Source: Cypress Semiconductor)*
In certain applications, it is required to wake up the device based on specific combination of multiple events and process the event. Microcontrollers available in the market today require the CPU to wake up to detect this pattern and process the event. This causes the CPU to unnecessarily wake up at each event and check for the specific combination, which results in increased power consumption.
Smart I/O can work in low-power modes and be used to wake up the device based on a specific combination of multiple events. Figure 10 shows an application where the MCU wakes from deep sleep based on a specific combination of multiple events. In this case, only when both the inputs are high (i.e., it is dark and the window is open) the device wakes up and sends the sensor status to the receiver or drives an alarm to inform the user to lock all the doors.
__Figure 10:__ *Detecting Specific Pattern using PSoC 4 Smart I/O (Source: Cypress Semiconductor)*
An implementation of this system is shown in Figure 11. The inputs from the two I/O pins are AND-ed by the Smart I/O block and fed to the CPU wakeup interrupt controller to wake up the device from deep sleep (Figure 12). Waking up only when both the conditions are TRUE results in reduced device power consumption and longer battery life.
__Figure 11:__ *Detecting Specific Input Pattern – PSoC Creator Implementation (Source: Cypress Semiconductor)*
__Figure 12:__ *Implementing AND gate using Smart I/O (Source: Cypress Semiconductor)*