This application note is a design guide that highlights the various types of applications, preferably suited for the PIC24FJ128GC010 family of intelligent analog microcontrollers. The sample designs in this document are only a starting point reference and are not used to represent a finished product. Few of the applications shown in this document will have a need for agency approval (FDA, UL, CE or others) and these applications are not fully tested to meet these approvals.
The PIC24FJ128GC010 family combines a high-speed, 16-bit PIC24 MCU with analog peripherals. Along with digital blocks, such as USB and a Liquid Crystal Display (LCD) Controller, the PIC24FJ128GC010 has a 12-bit, 10 Msps Pipeline ADC, a 16-bit Sigma-Delta ADC, plus two op amps and a 2-channel, 10-bit Digital-to-Analog Converter (DAC).
The following section will discuss the features of each analog module in the PIC24FJ128GC010.
Analog Modules in the PIC24FJ128GC010
16-Bit Sigma-Delta A/D Converter (SD_ADC) FRM (DS30687)
The SD_ADC is a high-accuracy, high-resolution ADC for signals in the DC-4 kHz range. The converter has an inherent, low-pass filter characteristic ideal for lower bandwidth sources, such as AC power line monitoring, temperature probes, weight scales, pressure transducers and bridge measurements. There are two input channels routed to a fully differential PGA (Programmable Gain Amplifier), which greatly simplifies measurements in single supply, high common-mode conditions. In most cases, a one-pole filter is sufficient for anti-aliasing.
Dither may improve AC measurements when using the SD_ADC.(1) There are three dithering levels selectable in the SD1CON1 Special Function Register (SFR). Dither has the effect of spreading out the spectrum of the input signal, which reduces spectrum peaks, and thereby, improving overall SNR (Signal-to-Noise Ratio). The adding of low-level noise to the input signal will counter the effect of the quantization noise inherent in all ADCs.(2)
Sigma-Delta ADCs have higher gain and offset errors which must be compensated. The PIC24FJ128GC010 has special measurement modes to measure the gain and offset errors, which are then used in a simple in-line calculation by the MCU firmware to produce the final ADC reading. See the “Basic Building Blocks” section for a detailed firmware example using the gain and offset calculations.
12-Bit, High-Speed Pipeline A/D Converter FRM (DS30686)
The pipeline ADC is a very high-speed, 12-bit ADC that can achieve 10 million conversions a second. The PIC24FJ128GC010 has 50 individual input channels that can be either capacitive touch pads or standard voltage inputs. Due to the higher noise floor, samples must be averaged to get the best results.
Operational Amplifier (Op Amp) (DS30505)
There are two independent op amp modules that have programmable speed/power settings. The Power-on Reset (POR) state is the low-power/low-speed configuration. The op amps have very low input bias current (<10 pA), but the input offset voltage may need compensation in the design.
10-Bit Digital-to-Analog Converter (DAC) (DS39615)
The DAC module has two independent voltage outputs. There are several options to select the DAC’s reference voltage. The DACs are very useful for DC biasing the analog ‘front end’ of sensor amplifiers/filters, and can be used for tone generation and Adaptive Differential Pulse Code Modulation (ADPCM) speech playback in products. See Application Note: AN643, “Adaptive Differential Pulse Code Modulation Using PIC® Microcontrollers”(11) for more information.
Other Useful Modules
In addition to the above modules, the PIC24FJ128GC010 has internal band gap voltage references, a Charge Time Measurement Unit (CTMU) with Threshold Detect (DS39743), three comparators, an LCD Controller and USB OTG.
There are four major sections as follows:
Basic Building Blocks
Industrial Applications
Consumer/Appliance Applications
Medical Applications
Each section has several design examples showing the various analog peripherals. The last section is “Further Reading”, and has references and links to additional information.
Basic Building Blocks
The circuits presented in this section are not a complete product, but rather ‘building blocks’ used in combination with other circuitry. They perform specific, but commonly used, tasks found in most analog ‘front end’ measuring and generating circuits.
When using these design ideas, keep the following things in mind:
Additional circuitry may be needed for ESD protection, EMI filtering or other types of interference seen in an actual product.
Do not exceed the Common-Mode Voltages (VCM) for each module. These are listed in the “Electrical Characteristics” section of the “PIC24FJ128GC010 Family Data Sheet”.
Low-current/battery operated products may require special attention to component values and selection
Building Block #1: Current Monitoring
Perhaps the simples and lowest parts count applications is to measure current using a shunt resistor, and the PGA of the SD_ADC, as shown in Figure 1.
This configuration uses a differential input channel of the SD_ADC. The value of the resistor is usually selected as an even decade (1, 0.1, etc.) to make the current calculation easier. Lower resistances will dissipate lower wattage and can measure current in the tens of amps. The SD_ADC can measure AC or DC current as long as the voltage drop across the resistor is within the common-mode range of the PGA. The true differential input can detect positive or negative current flow reference to its input pins. Based on the current range expected and the resistor value, the gain of the PGA should be such that output voltage into the SD_ADC never exceeds the reference voltage used.