Do More With Advanced Peripherals of Next-gen PIC18 ‘Q10’ MCUs

The next-generation PIC18 ‘Q10’ family of microcontrollers with several easy-to-use Core Independent Peripherals (CIPs) and Intelligent Analog Peripherals meets the desired expectations and prove to be the right choice for most embedded applications. The CIPs of ‘Q10’ MCU benefits by reducing the firmware complexity, offering desired flexibility, and helping the systems to meet functional safety criteria.
Applications Requisites
A vast majority of embedded applications need more than computing power. System performance is purely application dependent, as the requirements vary from application to application. One application might need high accuracy, fast analog features and secure communication; whereas another application might be cost driven and may require multiple timers and communication interfaces integrated in MCU.
The most common embedded systems typically involve some type of sensing, power conversion, closed-loop control, and/or some communication activity. In general, the IoT is a deluge of smart, data collecting, decision-making devices that contribute to an informed world; a world where we can predict data more accurately that can be precisely trended. To contribute to IoT, the most basic of devices need only include a secure controller and some mean of transferring data to the cloud or wired/wireless communication medium. Thus, the required MCU selection exclusively depend on the application and may not need a huge memory or high processing power.
Considering the substantial increase in the presence of smart devices, our interaction with these devices is ever-present. Failure of these devices might be hazardous, as our dependency on them is sometimes profound. Therefore, systems must comply to certain safety requirements by having built-in safety mechanism, that helps to reduce the potential risk or lower the damage to a tolerable level when required.
To realize functional safety in embedded applications, the entire system should meet the criteria framed by the local safety regulations and industry standards. Being a prime segment in the embedded applications, microcontroller integrity, along with other parts, is critical to accomplish the system robustness when exposed to harsh environments.
Firmware and Its Limitations
Let’s consider a simple example of detecting a switch press event in any application. There are wide range of software solutions available to accomplish this. However, all these solutions require an algorithm and some processing to tackle the de-bounce issue or detect multi-press and long-press events, thus consuming CPU time, power and most probably one trivial interrupt service routine of critical priority (depending on the purpose of switch).
Furthermore, things will get more complicated if, instead of a switch press, an external pulse of significantly smaller time period is to be detected. Missing it being the most prominent of all. The other challenge you might run into very frequently while detecting pulse is glitches. Getting rid of glitches in software is always a challenge as sometimes it is assessed as ‘1’ and sometimes ‘0’, never sure of either.
Measurement of analog signals via an Analog to Digital Converter is one of the most basic requirements of many applications. These measurements often require averaging and low pass filtering on the acquired data. Software based filters for removing the noise are time consuming and complex whereas averaging of data needs a lot of memory.
Latency is another issue that comes with software; even if the you prioritize all tasks optimally. Tasks of same and lower priorities must wait till the higher priority task finishes. This can be safety critical in some applications. If some application needs to assess two concurring signals, software can only do it sequentially. Processing real time signals is difficult in software as CPU is synchronous, which adds to at least one clock cycle delay from input to output.
A vast number of such complications are very common while developing applications. Overcoming them always require complex code routines or external hardware circuits, which will add up to the development time and cost of the application. Adding a simple CRC check for flash program can be a very complicating task to develop and test. Processing of these complex codes consume CPU time and power. Offloading them from the CPU can enable you to extend MCU sleep duration, while the CPU is not needed for computations. This helps in reducing the MCU’s average power consumption, which might be very critical in battery powered applications.
PIC18 ‘Q10’ family MCUs and Its Specialized Peripherals
The latest PIC18 ‘Q10’ family of microcontrollers from Microchip are optimized for robust, real-time control with integrated intelligent analog, configurable peripherals and 5V operation for noise immunity.
Each device includes a full complement of Core Independent Peripherals (CRC / Memory Scan, Configurable Logic Cells, Windowed Watchdog Timer, Hardware Limit Timer, etc.), PWMs and multiple communications interfaces. Additionally, the family include intelligent analog peripherals such as Zero Cross Detector (ZCD), on-chip Analog Comparators, Digital-to-Analog Converter (DAC) and an Analog-to-Digital Converter with Computation (ADC2). The ADC2 includes Hardware Capacitive Voltage Divider (CVD) Support for multichannel capacitive touch detection.
The PIC18 ‘Q10’ MCUs facilitate innovative design alternatives to software by using its intelligent analog and Core Independent Peripherals (CIPs). Once initialized, the CIPs provide steady state closed loop embedded control without any interruptions from the CPU. Since they are standalone peripherals and CPU independent there is zero latency in sharing data, logic signals, and/or analog signals. Also, the CIPs help in reducing firmware complexity and hence offloads the CPU. Thus, the CIPs enable you to design more complex applications with ease using PIC18 ‘Q10’ MCUs.
PIC18 ‘Q10’ MCUs for Embedded Applications
Microchip’s PIC18 ‘Q10’ family of MCUs comes with an abundance of peripherals targeting various real time applications. The PIC18 ‘Q10’ MCUs offer good level of integrity to the systems through robust silicon design and the manufacturing process, that help to improve system robustness. The Windowed Watchdog Timer, to recover from runaway code, enable desired safety features in applications. Security is another sought-after feature in applications. The on-chip CRC module saves a lot of time and power consumption in communication applications. The Memory Scan feature provides firmware self-testing for Over-the-Air (OTA) upgrades and system boots, preventing system compromise.
Configurable Logic Cells (CLCs), when used diligently, turns out to be a very powerful asset. CLC can be configured to any basic logic gate and/or sequential element to perform a countless number of tasks. For example, while reading small period pulses the glitches can be completely avoided by using the CLC in D flip-flop configuration. Reading two concurring signals is plain sailing for the CLC, over that any digital logic can also be built on these two input signals like OR, AND, NOR etc. giving the desired output. The CLC can be used in conjunction to itself, other CLCs and/or other peripherals also. This versatility gives you the flexibility to create innovative designs. Applications such as Encoder, Decoder, Counter, Pulse Extender, Cyclo-converter, Finite state machines can be easily realized using the CLCs.
Coming back to the switch de-bounce problem, the robust de-bounce mechanism required to detect a switch press event can also be realized with the Hardware Limit Timer (HLT) feature of timer peripheral without the need of any firmware logic implementation. The timer can detect rising or falling (or both if needed) edge of the switch press and then generate an event after the required pre-programmed delay (to overcome the de-bounce fluctuations). The CLCs can also be used for implementing switch de-bounce logic. Hardware Limit Timer (HLT) is also useful in safety critical applications to detect the potential faulty conditions and take appropriate corrective measures to recover the system from the fault state, which helps the system to perform predictably.
While working with analog signals, intelligent analog peripherals such as ADC2 with CVD, comparator and ZCD comes in very handy. The built-in post-processing computational features of ADC2 module enable you to perform average, burst average, oversampling, Low-Pass-Filtering, min/max threshold detection and a lot more operations at hardware level only. Together with CVD technique, the ADC2 module can also be used for capacitive touch detection in Human Machine Interface (HMI) applications. You can add intuitive touch buttons to your design and avoid external touch modules.
Analog comparator and ZCD are also very useful peripherals in analog signal processing applications. Both the peripherals provide instantaneous signal level detection as they are asynchronous to CPU hence there is no output latency.
CIPs are meant to automate tasks that have customarily been executed by the CPU based on software code that you write, debug, test, and integrate into the entire system. PIC18 ‘Q10’ with CIPs offer more sleep time allowance without worrying about control schemes with the potential for competing interrupts where one goes ignored. It reduces the amount of software and interrupts, freeing up CPU, and allowing the operating frequency to be lowered to reduce power consumptions. CIPs and the intelligent analog peripherals of ‘Q10’ are next-gen solution to execute events in parallel with a compact single core MCU.
Development Ecosystem
Using the feature loaded PIC18 ‘Q10’ MCUs in any new design is seamless and straightforward. The PIC18 ‘Q10’ family of MCUs is supported by MPLAB X Integrated Development Environment (IDE) and cloud based MPLAB Xpress IDE. The MPLAB X IDE comes with a host of features to enhance the development and debug experience during the design phase and, offers a single integrated environment to develop applications for PIC and AVR MCUs. An intuitive MPLAB Code Configurator (MCC), available as plug-in to MPLAB X, provides a graphical programming environment that generates easy to understand C code in few clicks, saving you a lot of time and effort. This comprehensive and easy-to-use development ecosystem helps shorten the overall design cycle and time to market. The pin-to-pin compatibility with the former PIC MCUs ensures that you can easily migrate to ‘Q10’ family of MCUs to enhance functionality of an existing product, without an extensive re-design.
The ‘Curiosity Nano’ and ‘Curiosity HPC’ development boards from Microchip can be used to kick start the development and rapid prototyping using the ‘Q10’ family of MCUs. Designed from the ground-up to take advantage of Microchip’s MPLAB X and MPLAB Xpress development environment, Curiosity boards includes an integrated programmer/debugger and requires no additional hardware to get started.
Summary
The PIC18 ‘Q10’ family of MCUs provide an excellent combination of PIC CPU, CIPs, Intelligent Analog Peripherals, and communication peripherals among others to develop a system with high performance, integrity, design flexibility and low power consumption. The unique feature set and peripherals combination make them as favorable microcontrollers for numerous applications like, but not limited to, industrial process control, home appliances, sensor nodes, medical, Human Machine Interface, wireless connectivity, motor control and automotive. So, let’s get started into building a next-gen smart device for you next application.