Your vending machine can talk thanks to a 5 embedded modem

6,117

Circuit Image

Despite the remarkable growth of wireless connections, analog POTS, or "plain old telephone service," continues to excel in terms of cost and availability. Credit card terminals and home security systems are two examples of older connected devices. However, the expansion of connectivity stimulates innovative ideas and raises new expectations. A dialogue between a well-connected vending machine and its supplier illustrates this point. The vending machine states, "Machine 127 here. Today's sales were great, but I'm starting to run low. The temperature reached over 90°F by noon for the last three days, so I increased prices by $0.25. Should I raise it another $0.15 until my supplies are replenished?"

Embedded modems differ significantly from the standalone modems found in PCs. Typical embedded modems lack an attached terminal, and their user interface, if present, is simplified. The modem typically offers only a few basic commands and options, far fewer than those provided by the common Hayes Command set. Furthermore, an embedded system and its host tightly script the information exchange. Given that the content exchanged is relatively brief, high data rates are unnecessary. Transmitting a kilobyte of information, which is substantial for many embedded designs, at 300 baud usually takes less time than establishing a high-speed modem connection. Cost and reliability remain the primary considerations, and 300 baud offers robust performance in conditions that challenge high-speed modems. Lower data rates also present cost-saving opportunities in the design of both the modem and the telephone line interface, known as the Data Access Arrangement (DAA). Low-speed modem chipsets often utilize an inexpensive, dedicated microcontroller (MCU).

Programmable System on Chip (PSoC) microcontrollers provide a unique pathway to further cost reductions due to their ability to dynamically reconfigure peripheral capabilities. Dynamic reconfiguration allows designers to tailor a single device to a specific application and then change functions on the fly, reusing the same peripheral resources for different tasks. For instance, a PSoC device at the core of an embedded application can easily transform into a modem for data transmission and reception. Once the data transmission concludes, it can revert those peripheral assets to their primary functions in less than a millisecond, effectively rendering the modem function cost-free for many applications.

To comprehend this functionality, an overview of the PSoC architecture is essential. The PSoC MCU comprises configurable analog and digital hardware blocks, known as PSoC blocks. Unlike a block of programmable logic, digital PSoC blocks implement a predefined set of 8-bit functions. For broader functions, two or more blocks can be chained together. For example, two 8-bit PSoC blocks can be combined to create a 16-bit counter. Analog PSoC blocks include operational amplifiers with resistive feedback or switched capacitor arrays.

PSoC Designer, the integrated development environment (IDE) for PSoC microcontrollers, features a comprehensive library of "user modules" or predefined peripherals. These user modules are graphically represented in PSoC Designer's Device Editor, where they can be selected and assigned to specific PSoC blocks. Digital user module examples include timers, counters, pulse width modulators (PWM), dead band generators, pseudo-random sequence generators (PRS), and cyclical redundancy checkers (CRC). Communication user modules encompass Universal Asynchronous Receiver Transmitter (UART) and Serial Peripheral Interface (SPI) functions. PSoC Designer automatically generates firmware to configure the PSoC blocks and provides Application Programming Interfaces (APIs) to expedite development.

This document outlines the implementation of a Bell 103 and V.21 compatible 300-baud modem utilizing a PSoC microcontroller.Despite the astonishing proliferation of wireless connections, analog POTS or "plain old telephone service" still delivers on price and availability. Credit card terminals and home security systems provide two of the older, more pass examples connected devices.

However, growth in connectivity fuels new ideas and fosters novel expectations. Let`slisten in on a dialog between a well-connected vending machine and its supplier. (Vending machine) "Machine 127 here. today`s sales were great, but I`m starting to run low. The temperature reached over 90F by noon for the last three days, so I increased prices by $0. 25. Should I raise it another $0. 15 until my supplies are replenished " Embedded modems are very different from the stand-alone modems found in PCs. Typical embedded modems have no attached "terminal" and the user interface (if any) is greatly simplified.

The modem need offer only a few simple commands and options - far fewer than implemented by the common "Hayes Command" set. In addition, an embedded system and its host tightly script the exchange of information. Since the content exchange is relatively brief, high data rates are not necessary. Transmitting a kilobyte of information (which is significant for many embedded de-signs) at 300 baud usually takes less time than negotiating a high-speed modem connection.

Cost and reliability remain the dominant considerations and 300 baud provides robust performance under conditions that give high-speed modems fits. Lower data rates provide cost saving opportunities in the design of both the modem and the telephone line interface, known as the Data Access Arrangement (DAA).

Low-speed modem chip sets often rely on an inexpensive, but dedicated microcontroller (MCU). Programmable System on Chip (PSoC) microcontrollers provide an unprece-dented path to further cost reduction - thanks to its ability to dynamically reconfig-ure its peripheral capabilities. Dynamic reconfiguration means that designers can tailor a single device to a particu-lar application, and then change functions on the fly - re-using the same peripheral resources for a completely different task.

For example, a PSoC device at the heart of an embedded application can easily morph into a modem, transmitting and receiving data. When the data transmission is complete, it can return those same peripheral assets to their primary functions in less than a millisecond.

For many applications this means the modem is, essentially, free. To fully understand how this works, it is necessary to start with a brief overview of the PSoC architecture. The PSoC MCU includes configurable analog and digital hardware blocks (known as PSoC blocks). Unlike a block of programmable logic, digi-tal PSoC blocks implement a predefined set of 8-bit functions.

For wider functions, two or more blocks may be chained together. For example, two 8-bit PSoC blocks may be combined to create a 16-bit counter. Analog PSoC blocks contain op-amps with resistive feedback or switched capacitor arrays. PSoC Designer, the integrated development environment (IDE) for PSoC microcontrol-lers, includes a complete library of "user modules" or predefined peripherals. User modules are represented graphically in PSoC Designer`s Device Editor where they can be selected and assigned to specific PSoC blocks.

Examples of digital user modules include timers, counters, pulse width modulators (PWM), dead band generators, pseudo-random sequence generators (PRS) and cyclical redundancy checkers (CRC). User modules for communication include Universal Asynchronous Receiver Transmit-ter (UART), and Serial Peripheral Interface (SPI`) functions.

PSoC designer automati-cally generates firmware to configure the PSoC blocks and provides Application Pro-gramming Interfaces (API) to speed development. This article outlines an implementation of a Bell 103 and V. 21 compatible 300-baud modem using a PSoC microcontroller. The 🔗 External reference