New 8-bit PIC Microcontrollers: Intelligent Analog & Core Independent Peripherals

Microchip Technology, Inc. announced Monday from EE Live! and the Embedded Systems Conference in San Jose the PIC16(L)F170X and PIC16(L)F171X family of 8-bit microcontrollers (MCUs), which combine a rich set of intelligent analog and core independent peripherals, along with cost-effective pricing and eXtreme Low Power (XLP) technology. Available in 14-, 20-, 28-, and 40/44-pin packages, the 11-member PIC16F170X/171X family of microcontrollers integrates two op-amps to drive analog control loops, sensor amplification and basic signal conditioning, while reducing system cost and board space.

PIC16F170X/171X MCUs reduce design complexity and system BOM cost with integrated op-amps, zero cross detect, and peripheral pin select.

PIC16F170X/171X MCUs reduce design complexity and system BOM cost with integrated op-amps, zero cross detect, and peripheral pin select.

These new devices also offer built-in Zero Cross Detect (ZCD) to simplify TRIAC control and minimize the EMI caused by switching transients. Additionally, these are the first PIC16 MCUs with Peripheral Pin Select, a pin-mapping feature that gives designers the flexibility to designate the pinout of many peripheral functions.

The PIC16F170X/171X are general-purpose microcontrollers that are ideal for a broad range of applications, such as consumer (home appliances, power tools, electric razors), portable medical (blood-pressure meters, blood-glucose meters, pedometers), LED lighting, battery charging, power supplies and motor control.

The new microcontrollers feature up to 28 KB of self-read/write flash program memory, up to 2 KB of RAM, a 10-bit ADC, a 5-/8-bit DAC, Capture-Compare PWM modules, stand-alone 10-bit PWM modules and high-speed comparators (60 ns typical response), along with EUSART, I2C and SPI interface peripherals. They also feature XLP technology for typical active and sleep currents of just 35 µA/MHz and 30 nA, respectively, helping to extend battery life and reduce standby current consumption.

The PIC16F170X/171X family is supported by Microchip’s standard suite of world-class development tools, including the PICkit 3 (part # PG164130, $44.95), MPLAB ICD 3 (part # DV164035, $189.99), PICkit 3 Low Pin Count Demo Board (part # DM164130-9, $25.99), PICDEM Lab Development Kit (part # DM163045, $134.99) and PICDEM 2 Plus (part # DM163022-1, $99.99). The MPLAB Code Configurator is a free tool that generates seamless, easy-to-understand C code that is inserted into your project. It currently supports the PIC16F1704/08, and is expected to support the PIC16F1713/16 in April, along with all remaining microcontrollers in this family soon thereafter.

The PIC16(L)F1703/1704/1705 microcontrollers are available now for sampling and production in 14-pin PDIP, TSSOP, SOIC and QFN (4 x 4 x 0.9 mm) packages. The PIC16F1707/1708/1709 microcontrollers are available now for sampling and production in 20-pin PDIP, SSOP, SOIC and QFN (4 x 4 x 0.9 mm) packages. The PIC16F1713/16 MCUs are available now for sampling and production in 28-pin PDIP, SSOP, SOIC, QFN (6 x 6 x 0.9 mm) and UQFN (4 x 4 x 0.5 mm) packages. The PIC16F1718 microcontrollers are expected to be available for sampling and production in May 2014, in 28-pin PDIP, SSOP, SOIC, QFN (6 x 6 x 0.9 mm) and UQFN (4 x 4 x 0.5 mm) packages. The PIC16F1717/19 microcontrollers are expected to be available for sampling and production in May 2014, in 40/44-pin PDIP, TQFP and UQFN (5 x 5 x 0.5 mm). Pricing starts at $0.59 each, in 10,000-unit quantities.

Source: Microchip Technology, Inc.

An Engineer Who Retires to the Garage

Jerry Brown, of Camarillo, CA, retired from the aerospace industry five years ago but continues to consult and work on numerous projects at home. For example, he plans to submit an article to Circuit Cellar about a Microchip Technology PIC-based computer display component (CDC) he designed and built for a traffic-monitoring system developed by a colleague.

Jerry Brown sits at his workbench. The black box atop the workbench is an embedded controller and is part of a traffic monitoring system he has been working on.

Jerry Brown sits at his workbench. The black box atop the workbench is an embedded controller and part of  his traffic monitoring system project.

“The traffic monitoring system is composed of a beam emitter component (BEC), a beam sensor component (BSC), and the CDC, and is intended for unmanned use on city streets, boulevards, and roadways to monitor and record the accumulative count, direction of travel, speed, and time of day for vehicles that pass by a specific location during a set time period,” he says.

Brown particularly enjoys working with PWM LED controllers. Circuit Cellar editors look forward to seeing his project article. In the meantime, he sent us the following description and pictures of the space where he conceives and executes his creative engineering ideas.

Jerry's garage-based lab.

Brown’s garage-based lab.

My workspace, which I call my “lab,” is on one side of my two-car garage and is fairly well equipped. (If you think it looks a bit messy, you should have seen it before I straightened it up for the “photo shoot.”)  

I have a good supply of passive and active electronic components, which are catalogued and, along with other parts and supplies, are stored in the cabinets and shelves alongside and above the workbench. I use the computer to write and compile software programs and to program PIC flash microcontrollers.  

The photos show the workbench and some of the instrumentation I have in the lab, including a waveform generator, a digital storage oscilloscope, a digital multimeter, a couple of power supplies, and a soldering station.  

The black box visible on top of the workbench is an embedded controller and is part of the traffic monitoring system that I have been working on.

Instruments in Jerry's lab include a waveform generator, a digital storage oscilloscope, a digital multimeter, a couple of power supplies, and a soldering station.

Instruments in Brown’s lab include a waveform generator, a digital storage oscilloscope, a digital multimeter, a couple of power supplies, and a soldering station. 

Brown has a BS in Electrical Engineering and a BS in Business Administration from California Polytechnic State University in San Luis Obispo, CA. He worked in the aerospace industry for 30 years and retired as the Principal Engineer/Manager of a Los Angeles-area aerospace company’s electrical and software design group.

Remote Control and Monitoring of Household Devices

Raul Alvarez Torrico, a freelance electronic engineer from Bolivia, has long been interested in wireless device-to-device communication.

“So when the idea of the Internet of Things (IoT) came around, it was like rediscovering the Internet,” he says.

I’m guessing that his dual fascinations with wireless and the IoT inspired his Home Energy Gateway project, which won second place in the 2012 DesignSpark chipKIT challenge administered by Circuit Cellar.

“The system enables users to remotely monitor their home’s power consumption and control household devices (e.g., fans, lights, coffee machines, etc.),” Alvarez says. “The main system consists of an embedded gateway/web server that, aside from its ability to communicate over the Internet, is also capable of local communications over a home area wireless network.”

Alvarez catered to his interests by creating his own wireless communication protocol for the system.

“As a learning exercise, I specifically developed the communication protocol I used in the home area wireless network from scratch,” he says. “I used low-cost RF transceivers to implement the protocol. It is simple and provides just the core functionality necessary for the application.”

Figure1: The Home Energy Gateway includes a Hope Microelectronics RFM12B transceiver, a Digilent chipKIT Max32 board, and a Microchip Technology ENC28J60 Ethernet controller chip.

Figure 1: The Home Energy Gateway includes a Hope Microelectronics RFM12B transceiver, a Digilent chipKIT Max32 board, and a Microchip Technology ENC28J60 Ethernet controller chip.

Alvarez writes about his project in the February issue of Circuit Cellar. His article concentrates on the project’s TCI/IP communications aspects and explains how they interface.

Here is his article’s overview of how the system functions and its primary hardware components:

Figure 1 shows the system’s block diagram and functional configuration. The smart meter collects the entire house’s power consumption information and sends that data every time it is requested by the gateway. In turn, the smart plugs receive commands from the gateway to turn on/off the household devices attached to them. This happens every time the user turns on/off the controls in the web control panel.

Photo 1: These are the three smart node hardware prototypes: upper left,  smart plug;  upper right, a second smart plug in a breadboard; and at bottom,  the smart meter.

Photo 1: These are the three smart node hardware prototypes: upper left, smart plug; upper right, a second smart plug in a breadboard; and at bottom, the smart meter.

I used the simple wireless protocol (SWP) I developed for this project for all of the home area wireless network’s wireless communications. I used low-cost Hope Microelectronics 433-/868-/915-MHz RFM12B transceivers to implement the smart nodes. (see Photo 1)
The wireless network is configured to work in a star topology. The gateway assumes the role of a central coordinator or master node and the smart devices act as end devices or slave nodes that react to requests sent by the master node.

The gateway/server is implemented in hardware around a Digilent chipKIT Max32 board (see Photo 2). It uses an RFM12B transceiver to connect to the home area wireless network and a Microchip Technology ENC28J60 chip module to connect to the LAN using Ethernet.

As the name implies, the gateway makes it possible to access the home area wireless network over the LAN or even remotely over the Internet. So, the smart devices are easily accessible from a PC, tablet, or smartphone using just a web browser. To achieve this, the gateway implements the SWP for wireless communications and simultaneously uses Microchip Technology’s TCP/IP Stack to work as a web server.

Photo 2: The Home Energy Gateway’s hardware includes a Digilent chipKIT Max32 board and a custom shield board.

Photo 2: The Home Energy Gateway’s hardware includes a Digilent chipKIT Max32 board and a custom shield board.

Thus, the Home Energy Gateway generates and serves the control panel web page over HTTP (this page contains the individual controls to turn on/off each smart plug and at the same time shows the power consumption in the house in real-time). It also uses the wireless network to pass control data from the user to the smart plugs and to read power consumption data from the smart meter.

The hardware module includes three main submodules: The chipKIT Max 32 board, the RFM12B wireless transceiver, and the ENC28J60 Ethernet module. The smart meter hardware module has an RFM12B transceiver for wireless communications and uses an 8-bit Microchip Technology PIC16F628A microcontroller as a main processor. The smart plug hardware module shows the smart plugs’ main hardware components and has the same microcontroller and radio transceiver as the smart meter. But the smart plugs also have a Sharp Microelectronics S212S01F solid-state relay to turn on/off the household devices.

On the software side, the gateway firmware is written in C for the Microchip Technology C32 Compiler. The smart meter’s PIC16F628A code is written in C for the Hi-TECH C compiler. The smart plug software is very similar.

Alvarez says DIY home-automation enthusiasts will find his prototype inexpensive and capable. He would like to add several features to the system, including the ability to e-mail notifications and reports to users.

For more details, check out the February issue now available for download by members or single-issue purchase.

MCU-Based Projects and Practical Tasks

Circuit Cellar’s January issue presents several microprocessor-based projects that provide useful tools and, in some cases, entertainment for their designers.

Our contributors’ articles in the Embedded Applications issue cover a hand-held PIC IDE, a real-time trailer-monitoring system, and a prize-winning upgrade to a multi-zone audio setup.

Jaromir Sukuba describes designing and building the PP4, a PIC-to-PIC IDE system for programming and debugging a Microchip Technology PIC18. His solar-powered,

The PP4 hand-held PIC-to-PIC programmer

The PP4 hand-held PIC-to-PIC programmer

portable computing device is built around a Digilent chipKIT Max32 development platform.

“While other popular solutions can overshadow this device with better UI and OS, none of them can work with 40 mW of power input and have fully in-house developed OS. They also lack PP4’s fun factor,” Sukuba says. “A friend of mine calls the device a ‘camel computer,’ meaning you can program your favorite PIC while riding a camel through endless deserts.”

Not interested in traveling (much less programming) atop a camel? Perhaps you prefer to cover long distances towing a comfortable RV? Dean Boman built his real-time trailer monitoring system after he experienced several RV trailer tire blowouts. “In every case, there were very subtle changes in the trailer handling in the minutes prior to the blowouts, but the changes were subtle enough to go unnoticed,” he says.

Boman’s system notices. Using accelerometers, sensors, and a custom-designed PCB with a Microchip Technology PIC18F2620 microcontroller, it continuously monitors each trailer tire’s vibration and axle temperature, displays that information, and sounds an alarm if a tire’s vibration is excessive.  The driver can then pull over before a dangerous or trailer-damaging blowout.

But perhaps you’d rather not travel at all, just stay at home and listen to a little music? This issue includes Part 1 of Dave Erickson’s two-part series about upgrading his multi-zone home audio system with an STMicroelectronics STM32F100 microprocessor, an LCD, and real PC boards. His MCU-controlled, eight-zone analog sound system won second-place in a 2011 STMicroelectronics design contest.

In addition to these special projects, the January issue includes our columnists exploring a variety of  EE topics and technologies.

Jeff Bachiochi considers RC and DC servomotors and outlines a control mechanism for a DC motor that emulates a DC servomotor’s function and strength. George Novacek explores system safety assessment, which offers a standard method to identify and mitigate hazards in a designed product.

Ed Nisley discusses a switch design that gives an Arduino Pro Mini board control over its own power supply. He describes “a simple MOSFET-based power switch that turns on with a push button and turns off under program control: the Arduino can shut itself off and reduce the battery drain to nearly zero.”

“This should be useful in other applications that require automatic shutoff, even if they’re not running from battery power,” Nisley adds.

Ayse K. Coskun discusses how 3-D chip stacking technology can improve energy efficiency. “3-D stacked systems can act as energy-efficiency boosters by putting together multiple chips (e.g., processors, DRAMs, other sensory layers, etc.) into a single chip,” she says. “Furthermore, they provide high-speed, high-bandwidth communication among the different layers.”

“I believe 3-D technology will be especially promising in the mobile domain,” she adds, “where the data access and processing requirements increase continuously, but the power constraints cannot be pushed much because of the physical and cost-related constraints.”

Real-Time Trailer Monitoring System

Dean Boman, a retired electrical engineer and spacecraft communications systems designer, noticed a problem during vacations towing the family’s RV trailer—tire blowouts.

“In every case, there were very subtle changes in the trailer handling in the minutes prior to the blowouts, but the changes were subtle enough to go unnoticed,” he says in his article appearing in January’s Circuit Cellar magazine.

So Boman, whose retirement hobbies include embedded system design, built the trailer monitoring system (TMS), which monitors the vibration of each trailer tire, displays the

Figure 1—The Trailer Monitoring System consists of the display unit and a remote data unit (RDU) mounted in the trailer. The top bar graph shows the right rear axle vibration level and the lower bar graph is for left rear axle. Numbers on the right are the axle temperatures. The vertical bar to the right of the bar graph is the driver-selected vibration audio alarm threshold. Placing the toggle switch in the other position  displays the front axle data.

Photo 1 —The Trailer Monitoring System consists of the display unit and a remote data unit (RDU) mounted in the trailer. The top bar graph shows the right rear axle vibration level and the lower bar graph is for left rear axle. Numbers on the right are the axle temperatures. The vertical bar to the right of the bar graph is the driver-selected vibration audio alarm threshold. Placing the toggle switch in the other position displays the front axle data.

information to the driver, and sounds an alarm if tire vibration or heat exceeds a certain threshold. The alarm feature gives the driver time to pull over before a dangerous or damaging blowout occurs.

Boman’s article describes the overall layout and operation of his system.

“The TMS consists of accelerometers mounted on each tire’s axles to convert the gravitational (g) level vibration into an analog voltage. Each axle also contains a temperature sensor to measure the axle temperature, which is used to detect bearing or brake problems. Our trailer uses the Dexter Torflex suspension system with four independent axles supporting four tires. Therefore, a total of four accelerometers and four temperature sensors were required.

“Each tire’s vibration and temperature data is processed by a remote data unit (RDU) that is mounted in the trailer. This unit formats the data into RS-232 packets, which it sends to the display unit, which is mounted in the tow vehicle.”

Photo 1 shows the display unit. Figure 1 is the complete system’s block diagram.

Figure 1—This block diagram shows the remote data unit accepting data from the accelerometers and temperature sensors and sending the data to the display unit, which is located in the tow vehicle for the driver display.

Figure 1—This block diagram shows the remote data unit accepting data from the accelerometers and temperature sensors and sending the data to the display unit, which is located in the tow vehicle for the driver display.

The remote data unit’s (RDU’s) hardware design includes a custom PCB with a Microchip Technology PIC18F2620 processor, a power supply, an RS-232 interface, temperature sensor interfaces, and accelerometers. Photo 2 shows the final board assembly. A 78L05 linear regulator implements the power supply, and the RS-232 interface utilizes a Maxim Integrated MAX232. The RDU’s custom software design is written in C with the Microchip MPLAB integrated development environment (IDE).

The remote data unit’s board assembly is shown.

Photo 2—The remote data unit’s board assembly is shown.

The display unit’s hardware includes a Microchip Technology PIC18F2620 processor, a power supply, a user-control interface, an LCD interface, and an RS-232 data interface (see Figure 1). Boman chose a Hantronix HDM16216H-4 16 × 2 LCD, which is inexpensive and offers a simple parallel interface. Photo 3 shows the full assembly.

The display unit’s completed assembly is shown with the enclosure opened. The board on top is the LCD’s rear view. The board on bottom is the display unit board.

Photo 3—The display unit’s completed assembly is shown with the enclosure opened. The board on top is the LCD’s rear view. The board on bottom is the display unit board.

Boman used the Microchip MPLAB IDE to write the display unit’s software in C.

“To generate the display image, the vibration data is first converted into an 11-element bar graph format and the temperature values are converted from Centigrade to Fahrenheit. Based on the toggle switch’s position, either the front or the rear axle data is written to the LCD screen,” Boman says.

“To implement the audio alarm function, the ADC is read to determine the driver-selected alarm level as provided by the potentiometer setting. If the vibration level for any of the four axles exceeds the driver-set level for more than 5 s, the audio alarm is sounded.

“The 5-s requirement prevents the alarm from sounding for bumps in the road, but enables vibration due to tread separation or tire bubbles to sound the alarm. The audio alarm is also sounded if any of the temperature reads exceed 160°F, which could indicate a possible bearing or brake failure.”

The comprehensive monitoring gives Boman peace of mind behind the wheel. “While the TMS cannot prevent tire problems, it does provide advance warning so the driver can take action to prevent serious damage or even an accident,” he says.

For more details about Boman’s project, including RDU and display unit schematics, check out the January issue.