For more information visit www.microchip.com
For more product information visit: www.microchip.com/usb
Microchip Delivers Flash PIC® Microcontrollers with Full-Speed USB 2.0 Connectivity for Embedded Applications
The PIC18F2550, PIC18F2455,
PIC18F4550 and PIC18F4455
are Flash PIC® microcontrollers
with Full-Speed USB 2.0
connectivity and 48 MHz
operation, for 12 megabits-per-
second (Mbps) data-transfer
rates. In combination with a wide
variety of on-chip peripherals
and nanoWatt Technology power
management, these features provide a complete embedded-control
solution for designers working with USB in industrial, medical and many
other embedded applications.
The majority of USB-capable microcontrollers are optimized
exclusively for applications in the personal computing (PC)
peripherals and consumer markets, leaving a real void for
embedded applications. Microchip’s new USB PIC microcontroller
family makes the benefi ts of Full-Speed USB available to
a broader range of embedded applications that operate in
harsh environments and only occasionally connect to personal
computers. The new Full-Speed USB PIC microcontrollers
address these needs by integrating USB as one of the primary
serial interfaces, as opposed to the prevalent approach that adds
a serial-to-USB patch on top of a legacy design.
Applications Suitable for these USB PIC Microcontrollers:
• Industrial - manufacturing tools, data loggers, scanners,
smart displays, micro fuel cells, gambling-machine peripherals,
RFID readers, robot-controller interfaces, industrial timers,
gas-fl ow analyzers, cable-test fi xtures
• Medical - voice-activated applications, advanced wheel chairs,
research equipment automation
• Automotive - vehicle-network bus diagnostic tools, vehicle
trace recorders [black boxes], ultrasonic sensors); battery-
powered (handheld tools, sensors, security applications,
remote controls
• Consumer - business-card scanners, white-board digitizers,
voice recorders, uninterruptable power-supply systems, MP3
players, fi re alarms, security-system programmers
Key Product Features:
• 24 or 32 Kbytes of self-programmable Enhanced Flash memory which allows fi eld upgrades for end-applications via the USB port
• Advanced PMOS Electrically Erasable Cell (PEEC) Flash Technology provides high endurance of up to 100,000 erase/write cycles and long data retention of 40+ years
• Full-Speed USB 2.0 interface includes an on-board transceiver and a Parallel Streaming Port for direct data transfers to external peripherals with minimum CPU overhead
• 2 Kbytes of RAM (1 Kbyte of which can be a dedicated USB buffer)
• 256 bytes of EEPROM data memory
• EUSART for RS232, RS485 and LIN serial interfaces
• Master Synchronous Serial Port for I2C™ and SPI™ communication
• 10-bit Analog-to-Digital Converter with high accuracy (±1 LSB) and up to 12 input channels
• Two Analog Comparators
• Capture/Compare/PWM module with 16-bit capture and resolution
• Enhanced Capture/Compare/PWM module with dead-time control and fault-protection inputs
• Four Timers (3 x 16-bit, 1 x 8-bit)
• Programmable Brown-out Reset and Low-Voltage Detect circuits
• Enhanced In-Circuit Debugging capabilities with up to three hardware breakpoints
Development Tools:
The USB PIC microcontrollers are supported by Microchip’s world-class development
systems, including:
• MPLAB® Integrated Development Environment (IDE)
• MPLAB C18 C Compiler
• MPLAB ICD 2 In-Circuit Debugger
• MPLAB PM3 Universal Device Programmer
• PICDEM™ Full-Speed USB Demo Board (part # DM163025) and MPLAB ICE 2000 and
MPLAB ICE 4000 In-Circuit Emulator processor modules (part # PCM18XR0) - expected
to be available in December 2004
Availability
These USB PIC microcontrollers are planned for general sampling and volume production
in December 2004. They will be available in the following package options.
PIC18F2550 and PIC18F2455 - 28-pin SDIP, SOIC
PIC18F4550 and PIC18F2455 - 40-pin SDIP, 44-pin TQFP, QFN
PAGE 1 Flash PIC® Microcontrollers with Full-Speed USB 2.0
Connectivity for Embedded
Applications
PAGE 2 Microchip Adds More I/O to Baseline PIC Microcontroller Family
PAGE 3 Microchip Converts to RoHS-Compliant, Lead (Pb)-Free Packaging
PAGE 4 Microchip Debuts Low-Cost, 8-Gain-Step SPI™ Bus Programmable Gain Amplifier
PAGE 5 Introducing Industry’s Most Accurate Two-Wire Thermal Sensors in SOT-23 Packages
PAGE 6 Free Software Modem Libraries Supporting 16-bit dsPIC® Digital Signal Controllers
PAGE 7 dsPIC Digital Signal Controllers (DSCs) —Introductory Seminars
Upcoming WebSeminars
Archived WebSeminars
PAGE 8-10 Tips n’ Tricks: PICmicro®
Microcontroller Comparators
PAGE 11 -12 What’s New in Microchip
Literature?
PAGE 13 Web Site Highlights
IN THIS ISSUE
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
For more information visit www.microchip.com 2
First baseline PIC® microcontroller in a
40-pin package offers cost-effective I/O.
The PIC16F59 is Microchip’s fi rst baseline 8-bit PIC microcontroller to be offered in 40- and
44-pin packages. The PIC16F59 targets cost-constrained applications that require additional input
and output pins (I/O), such as the appliance market. These cost-effective microcontrollers feature
2K words of Flash program memory and low-power (100 nA) sleep current.
Designers of embedded control products have a growing need for 8-bit microcontrollers with
increased I/O. The PIC16F59 microcontroller helps solve this design concern with up to 32 pins of
I/O at very cost-effective price points.
“Many of today’s cost-constrained applications have a great need for additional I/O,” said Steve
Drehobl, Vice President of Microchip’s Security, Microcontroller and Technology Division. “The
PIC16F59 provides engineers with the option of adding I/O to their designs without having to pay
for performance and features they don’t need.”
Key features of the PIC16F59 microcontroller include:
• 2K words of Flash program memory and 134 bytes of RAM
• Baseline core with 33 instructions and 2 stack levels
• 25 mA source/sink current I/O
• Low power (100 nA) sleep current
• One 8-bit timer and one watchdog timer
• In-Circuit Serial Programming™ capability
• Wide voltage range of 2.0 – 5.5 volts
Product Applications:
The PIC16F59 is perfectly suitable in applications such as:
• High-speed automotive
• Home appliances (dishwashers, washing machines, clothes dryers, blenders)
• Low-power remote transmitters and receivers
• Pointing devices and telecom processors
• Mechatronics (switch matrices, LED displays, toys)
• Consumer electronics (user interfaces, I/O expanders, keypads)
The Flash technology makes customizing application programs (transmitter codes,
motor speeds, receiver frequencies, etc.) extremely fast and convenient. The small
footprint packages, for through-hole or surface mounting, make this microcontroller ideal
for applications with space limitations. Low-cost, low-power, high-performance, ease-of
use and I/O fl exibility make the PIC16F5X series very versatile, even in areas where no
microcontroller use has been considered before (e.g., timer functions, replacement of
“glue” logic in larger systems and co-processor applications).
Development Tools:
The PIC16F59 is supported by Microchip’s standard, high-performance development
systems, including:
• MPLAB® Integrated Development Environment (IDE)
• PICkit™ 1 Flash Starter Kit
• PRO MATE® II
• MPLAB PM3 Universal Device Programmer
• PICSTART® Plus and Baseline Flash Microcontroller Programmer
Availability
General sampling and volume production is available now.
For more information, contact your authorized worldwide distributor or visit Microchip’s
Web site at www.microchip.com
For more product information visit:
www.microchip.com/PIC16F59
Microchip Adds More I/O to Baseline PIC® Microcontroller Family
For more information visit www.microchip.com 3
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
Microchip Announces Conversion to RoHS-Compliant, Lead (Pb)-Free Packaging
For more product information visit:
www.microchip.com/pbfree
Microchip’s Packaging Conversion Provides Forward and Backward Compatibility While Keeping
Prices at Parity With Existing Tin/Lead (SnPb)-Plated Material.
Beginning January 2005, in compliance with pending worldwide government regulations and
industry standards, Microchip is expected to begin conversion of all of its product packaging
to environmentally friendly, lead (Pb)-free plating. The Company has selected matte tin
(Sn) as its new plating material. This ensures that all Microchip products are backward
compatible with industry-standard, tin/lead-based soldering processes, and forward
compatible with higher-temperature Pb-free processes that are used with Pb-free pastes
such as tin/silver/copper (SnAgCu).
The European Union “Restrictions on Hazardous Substances” (RoHS) directive is scheduled
to go into effect on July 1, 2006 and governs all electronic equipment manufactured or sold
in the European Union member countries. This directive limits the amount of Pb in electronic
equipment. By enabling customers to convert to Pb-free semiconductors early, Microchip is
helping them to eliminate Pb from their manufacturing processes well ahead of schedule.
Microchip expects to phase out its inventory of tin/lead (SnPb)-plated products far in
advance of the 2006 deadline.
Matte tin was selected as the new plating material to replace current SnPb plating. In fact,
matte tin plating has been shipping in volume production from Microchip, under dedicated
Pb-free part numbers, for more than a year. Microchip is able to retain Moisture Sensitivity
Level 1 (MSL1) at 260°C, which is the higher soldering temperature required by some
Pb-free soldering systems — ensuring forward compatibility.
Availability
For most of Microchip’s packages in the new matte tin finish, sample availability and volume
production are expected to begin in January 2005. A mix of SnPb and Pb-free material
is expected to ship during 2005, while the existing inventory of SnPb-plated products is
depleted and replaced with Pb-free material.
Qualification Data for Pb-Free Conversion
Microchip has pursued careful and robust qualification for Pb-free conversion. Testing
includes:
• JEDEC MSL temperature/humidity pre-conditioning
• High-temperature JEDEC reflow profiles to 260°C
• Bond shear and bond wire pull strength
• HAST (Highly Accelerated Stress Test)
• Moisture resistance
• Autoclave
• Temperature cycling
• Thermal shock
• Dynamic life testing
• Endurance cycling and retention bake
• Whisker testing to NEMI recommendations
• Solder wettability/solderability at low and high temperatures
• Solder wettability/solderability with SnPb and Pb-free solders
• Testing across all applicable package types
• Testing across all semiconductor processes
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
For more information visit www.microchip.com 4
Microchip’s MCP6S91/2/3 are analog Programmable Gain Amplifi ers (PGAs). The ability to
configure the system gain and signal path during operation allows maximum flexibility for system
self-calibration and other system operation adjustments in a user transparent manner while the
end application is in use.
The MCP6S9X devices are programmed over the SPI™ bus, giving users control of the gain and
input channel selection and the design flexibility that otherwise could not be achieved easily. The
SPI bus is used to select the gain level and the input channel, providing analog input expansion
for a microcontroller or digital signal processor. This reduces the cost of the microcontroller by
lowering the number of input/output pins needed. Moreover, the multiple channels for the same
signal path enable system self-calibration of the analog signal path, enhancing accuracy over
time and temperature.
“Microchip has created a truly innovative way to interface analog signals to a microcontroller,”
said Art Eck, Marketing Manager for Microchip’s Analog and Interface Product Division. “By
controlling an amplifier digitally, the design is no longer fixed and can be modified in operation on
the fly, reducing the need for external components.”
These PGAs are optimized for high-speed, low offset voltage and single-supply operation with
rail-to-rail input and output capability. These specifi cations support single-supply applications
needing fl exible performance or multiple inputs. Target applications for this product include
industrial and instrumentation markets as well as signal and sensor processing.
MCP6S9X Applications
• A/D converter driver
• Multiplexed analog applications
• Data acquisition
• Industrial instrumentation
• Test equipment
• Medical instrumentation
MCP6S9X Features
• Available in 1- and 2-channel inputs
• Eight-gain steps with an amplifier bandwidth of 1 MHz to 18 MHz
• Lower supply current, which reduces power supply demands
• Supply voltage operation: 2.5V to 5.5V
• Operates over a -40°C to +125°C range
• Low noise: 10 nV/rtHz
• Low offset voltage: 50 µV, THD+N 0.0011 percent
• 200 ns settling time and gain steps of 1, 2, 4, 5, 8, 10, 16 & 32V/V
Availability
Samples and volume quantities are available now in the following packages:
MCP6S91 - 8-pin PDIP, SOIC and MSOP
MCP6S92 - 8-pin PDIP, SOIC and MSOP
MCP6S93 - 10-pin MSOP
For more information, contact your authorized worldwide distributor or visit Microchip’s
Web site at www.microchip.com
For more product information visit:
www.microchip.com/MCP6S9X
Low-Cost, 8-Gain-Step SPI™ Bus Programmable Gain Amplifier Enables Digital Control of the Analog Domain
Microchip introduced a programmable
gain amplifier family that provides digital
control over the amplifier function and
design.
For more information visit www.microchip.com 5
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
The industry’s most accurate digital-temperature sensors in space-saving SOT-23 packages are
here. With a ±1°C maximum temperature error, these devices retrieve temperature data, digitally
convert it and communicate the information to the microcontroller or central processing unit. This
enables designers to better protect their applications and to respond to thermal changes faster as
the device accurately measures temperature, protects and/or calibrates the system and provides
thermal information using minimal board space.
Microchip’s MCP980X devices convert and communicate the temperature data in about
30 milliseconds (for 9-bit resolution) via an industry standard I2C™ or SMBus interface, enabling
fast identification of thermal issues within the system. Available in a SOT-23 package and no
external components necessary, designers can minimize board space and component count while
offering sophisticated thermal protection to their applications.
These digital-temperature sensors only use 200 microamps of operating current and have
a shutdown current of 0.1 microamp, which extend battery life. With a one-shot temperature
measurement mode the devices wake up only when the temperature needs to be read and then
return to sleep, which also minimizes power consumption.
The devices offer high resolution (up to 12-bits) which allows for quick anticipation of temperature
changes and detection of minor trends in degree changes. This flexible temperature resolution
adjusts the conversion time depending on the system needs, assuring that the temperature is
read and communicated faster.
The SMBus system time-out available on the MCP9802/3 devices enable better system reliability
by preventing the communication bus from locking up.
MCP980X Features
• Temperature-to-digital converter
• Accuracy with 12-bit resolution:
– ±0.5°C (typ.) at +25°C
– ±1°C (max.) from -10°C to +85°C
– ±2°C (max.) from -10°C to +125°C
– ±3°C (max.) from -55°C to +125°C
• User-selectable resolution: 9 – 12 bit
• Operating voltage range: 2.7V to 5.5V
• 2-wire interface: I2C™/SMBus compatible
• Operating current: 200 µA (typ.)
• Shutdown current: 1 µA (max.)
• Power-saving, one-shot temperature measurement
MCP980X Applications
• Personal computers and servers
• Hard disk drives and other PC peripherals
• Entertainment systems
• Offi ce equipment
• Data communication equipment
• Mobile phones
• General-purpose temperature monitoring
Availability
Samples and volume quantities are available now in the following packages:
MCP9800/2 - SOT-23
MCP9801/3 - 8-pin MSOP, SOIC
For more information, contact your authorized worldwide distributor or visit Microchip’s
Web site at www.microchip.com
For more product information visit:
www.microchip.com/MCP980X
Microchip Introduces Industry’s Most Accurate Two-Wire Thermal Sensors in SOT-23 Packages
Devices communicate thermal data
to microcontroller for better system
protection
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
For more information visit www.microchip.com 6
Microchip Debuts Free Software Modem Libraries Supporting 16-bit dsPIC Digital Signal Controllers (DSCs)
For more product information visit: www.microchip.com/libraries
Microchip has announced the availability of the V.22bis/V.22 Software Modem Library
(2400 bps) and the V.32bis/V.32 Software Modem Library (14.4 Kbps). These sophisticated
Modem Libraries support the Company’s 16-bit dsPIC® digital signal controllers and are
ideally suited for the growing number of high-performance embedded designs that need to
communicate short messages and transactions through telephone lines. For short messages,
these libraries significantly outperform protocols with faster data rates when comparing total
connection time. The V.22bis/V.22 Software Modem Library is available at no cost to users,
reducing size and component count while enabling faster time to market.
“The dsPIC digital signal controllers offer significantly more performance than is available on
traditional 8- or 16-bit microcontrollers, while remaining in the same price range,” said Sumit
Mitra, Vice President of Microchip’s Digital Signal Control Division. “Our Software Modem
Libraries enable designers to gain a competitive edge with their products either through cost
reduction or by using connectivity to enable new features.”
These Modem Libraries address two important trends in embedded design:
• The need for enhanced connectivity among embedded applications.
• Reduction in total system-cost by using a software-based modem solution in place of
dedicated hardware. The Libraries can control call transactions (AT command set) and
modulate/demodulate the signals that are transferred over the communication medium
(telephone lines in this case). The dsPIC digital signal controllers provide the processing
horsepower to support the software modem plus handle the traditional microcontroller task
loading.
Applications suitable for these Software Modem Libraries:
• POS terminals, set-top boxes, drop boxes, fire panels
• Internet-enabled home security systems; Internet-enabled power, Internet-enabled
vending machines
• Gas and water meters, smart appliances, industrial monitoring
• Remote diagnostics for portable medical equipment
The V.22bis/V.22 Software Modem Library consists of the following International
Telecommunications Union (ITU)-T compliant components:
• V.22bis/V.22, V.23, V.21/Bell 103 and V.42
The V.32bis/V.32 Software Modem Library consists of the following ITU-T compliant
components:
• V.32.bis/V.32, V.22bis/V.22, V.23, V.21/Bell 103 and V.42
Both Libraries support single-channel data-pump implementations. Each data Modem
Library is provided with a respective library archive containing all of the data pump object
code modules required to link to the user’s application. Hardware component drivers,
such as UART and dsPIC30F data converter interface (CODEC Interface) for DAA/AFE
I/O, are provided in assembly source code for linking with the user’s application. The ITU-T
Recommendation V.42 is provided with each library. V.42 contains a High Level Data Link
Control (HDLC) protocol referred to as Link Access Procedure for Modems (LAPM) and
defines error-correcting protocols for modems.
Electronic documentation accompanies the modem library to help users become familiar
with and implement the library functions. A comprehensive Soft Modem Library User’s Guide
(DS71036) describes the required APIs for the AT, V.42 and data pump layers.
ITU-T Recommendation Bit Rate
(bps)
Start-Up Procedure
(sec)
V.32bis(1) 14400 6(2)
V.32 9600 6(2)
V.22bis 2400 3
V.22 1200 2
V.23 600/1200 1
V.21/Bell 103 300 1
1. Data pump modules, V.21, V.22, V.22bis, V.23, V.32, V.32bis and Bell 103 are implemented in Assembly language.
V.42, Data Pump and AT Command APIs are implemented in C language. 2. The program/data memory usage for the V-series data pumps is NOT cumulative, due to the sharing of components
internally.
For more information visit www.microchip.com 7
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
A new world of Digital Signal Control is here.
The time has come to unleash your imagination with the
dsPIC® Digital Signal Controller (DSC) from Microchip.
Seamlessly blending a powerful 16-bit microcontroller (MCU)
with outstanding Digital Signal Processing (DSP) capabilities,
the dsPIC DSC brings the best of both worlds to your fi ngertips.
The dsPIC DSC breezes through demanding real-time control
and fast, complex algorithm processing with equal ease, all in
a package size as small as a pencil eraser. With an easy-to-
use MCU look and feel, best in class C effi ciency, cost-effective
Flash, low-cost, real-time development tools and a substantial
portfolio of libraries – the dsPIC DSC is the solution for you!
Join us for a six-hour seminar and learn how to apply this exciting
new family into your designs. Don’t waste time – register
today for a seminar in the following locations:
Toronto, ONT: 11/30
Montreal, Quebec: 12/1
Ottawa, ONT: 12/2
Digital Signal Controller
For more information visit: www.microchip.com/webseminars
WebSeminar Series on www.microchip.com/webseminars
December 15, 1:00 PM Pacific Time
Developing Intelligent Power Systems Using the MCP1630 High-Speed PWM
Abstract: New design methods and components bring a high level of
intelligence to power system applications. This web seminar will introduce
the MCP1630; Microchips high-speed pulse-width-modulator developed
for embedded power system applications. Design examples will be used to
demonstrate intelligent power system features and capabilities as a result of
combining the MCP1630 with a PIC® microcontroller.
Presenter: Terry Cleveland, Analog-Mixed-Signal Product Applications Engineer
Terry Cleveland has more than 20 years of experience in the microelectronics industry. He
began his career with IBM, spending 5 years as a System Engineer developing semiconductor
test equipment and 5 years as a Product Failure Analysis Engineer analyzing new components
and field failures. Terry spent an additional 8 years as a Power Systems Design Engineer with
IBM, Celestica and Lockheed Martin Control Systems. Since joining Microchip Technology 3
years ago as a Product Applications Engineer, Terry has taken on the role of defining new
power management products and applications along with assisting customers with their
power management designs. His current interests are in developing applications and products
for power supplies that employ embedded microcontrollers. Terry received his BSEE from
Polytechnic University of Brooklyn and his MSEE from Binghamton University.
Stop holding your breath........ Archived WebSeminars That May Interest You
Archived versions of the WebSeminars shown in the table below are available for
you to download and view whenever you wish.
Title Category Date Duration
64 KByte Flash MCUs in 28- and 40-pin packages, the
PIC18F4620 and PIC18F2620
Products Oct 2004 20 min.
Introduction to the Signal Analysis PICtail™ Daughter Board Dev. Tools Oct 2004 30 min.
Basic dsPIC® Development Tools Dev. Tools Oct 2004 25 min.
Introduction to MPLAB® SIM Software Simulator Dev. Tools Sep 2004 25 min.
Get Started with the 64/80-pin TQFP Demo Board Dev. Tools Sep 2004 20 min.
Tips and Tricks Using MPLAB® v6.61 Dev. Tools Sep 2004 30 min.
Introduction to the PIC18F High Pin-Count and High
Density Family of Devices
Dev. Tools Sep 2004 20 min.
Introduction to the MPLAB® Visual Device Initializer (VDI) Dev Tools Aug 2004 30 min
Selecting the Ideal Temperature Sensor Analog Aug 2004 30 min
PIC10F Development Tools: Small Tools for Small Parts Dev Tools Aug 2004 30 min
An Introduction to the Controller Area Network (CAN) Interface Jun 2004 30 min
Control the World with the World’s Smallest
Microcontroller (PIC10F)
Products Jun 2004 30 min
Predict the Repeatability of Your ADC to the Bit Analog May 2004 20 min
What Does “Rail-to-Rail” Operation Really Mean? Analog Apr 2004 20 min
Introduction to MPLAB® IDE Dev. Tools Mar 2004 25 min
Lithium-Ion Battery Charging: Techniques and Trade-offs Analog Mar 2004 20 min
Techniques that Reduce System Noise in ADC Circuits Analog Feb 2004 20 min
Introduction to Microchip’s Development Tools Dev. Tools Feb 2004 25 min
Wireless Communication Using the IrDA® Standard Protocol Applications Jan 2004 20 min
Driving Lumileds LEDs with Microchip Microcontrollers Applications Jan 2004 60 min
AC Induction Motor (ACIM) Control Using the PIC18FXX31 Motor Control Jan 2004 20 min
Peripheral-Rich, Low Pin-Count, PIC® Microcontrollers
with nanoWatt Technology
Products Jan 2004 30 min
Brushless DC Motor (BLDC) Motor Control Using PIC18FXX31 Motor Control Dec 2003 20 min
Smaller Packages = Bigger Thermal Challenges Analog Dec 2003 20 min
Design Considerations When Adding CANbus to Your System Applications Nov 2003 20 min
Select the Right Operational Amplifi er for Your Filtering Circuits Analog Oct 2003 20 min
Amplify Sensor Signals Using the PGA Analog Sep 2003 20 min
Microchip’s nanoWatt Technology Products Apr 2003 45 min
Introductory Seminars
www.microchip.com
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
For more information visit www.microchip.com 8
Once the gain has been determined, values for R3 and C2 can be determined. R3 and C2
form a low-pass fi lter on the output of the amplifi er. The corner frequency of the low-pass
should be 2 to 3 times the maximum frequency of the signal being amplifi ed to prevent
attenuation of the signal and R3 should be kept small to minimize the output impedance of
the amplifi er. Equation 1-2 shows the relationship between R3, C2 and the corner frequency
of the low-pass fi lter.
Tips n’ Tricks - PICmicro® Microcontroller Comparators
TIP 1. Making an Op Amp Out of a Comparator
When interfacing to a sensor, some gain is typically required to match the full range of the sensor
to the full range of an ADC. Usually this is done with an operational amplifi er, however, in cost
sensitive applications, an additional active component may exceed the budget. This tip shows
how an on-chip comparator can be used as an op amp like gain stage for slow sensor signals.
Both an inverting and non-inverting topology are shown in Figure 1-1 and Figure 1-2.
Gain =
R1 + R2
Equation 1-1:
R2
InputOutput
C2
R3Comparator
R2
C1 R1
Figure 1-1 Non-Inverting Amplifier
FCORNER =
1
Equation 1-2:
2 * PI * R3 * C2
Figure 1-2 Inverting Amplifier
Input
Output
C2
R3
Comparator
R2
C1 R1
VDD
10K
10K
To design a non-inverting amplifi er, choose resistors R1 and R2 using the Gain formula for an
op amp non-inverting amplifi er (see Equation 1-1).
A value for C1 can then be determined using Equation 1-3. The corner frequency should
be the same as Equation 1-4.
FCORNER =
1
Equation 1-3:
2 * PI * (R1 II R2) * C2
Gain =
R1
Equation 1-4:
R2
Then choose values for the resistor divider formed by R4 and R5. Finally, choose C1 and
C2 as shown in the non-inverting amplifi er design.
Example:
• For C2 will set the corner F
• Gain = 6.156, R1 = R3 = 19.8k
• R2 = 3.84k, C1 = .047 µF, FCORNER = 171 Hz
• C2 = .22 µF
I have occasionally been asked, why are we putting comparators on small pin-count microcontrollers? The reason is because the comparator is the simplest, and most versatile, mixed-signal
peripheral available and adding it to a microcontroller turns a simple, small microcontroller into a mixed-signal power-house. Suddenly a variety of sensor and control circuits are possible with
just a handful of external components: Logic gates, sensors, even A/D’s, and we show you how, right here. So watch microSolutions for new Comparator Tips-n-Tricks each month.
For more information visit www.microchip.com 9
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
FSWX =
2
Equation 2-1:
Tips n’ Tricks - PICmicro® Microcontroller Comparators
Ripple Current
Load Current
Drive Level
Time
Figure 2-2 Comparator with Hysteresis
TIP 2. PWM High-Current Driver
This tip combines a comparator with a MOSFET transistor and an inductor to create a
switch mode high-current driver circuit. (See Figure 2-1.)
Figure 2-1. High Current Driver
R3
Comparator
R2
C1R1
VDD
DriveLevel
Load
P chMOSFET
The operation of the circuit begins with the MOSFET off and no current fl owing in the
inductor and load. With the sense voltage across R1 equal to zero and a DC voltage
present at the drive level input, the output of the comparator goes low. The low output
turns on the MOSFET and a ramping current builds through the MOSFET, inductor, load
and R1.
When the current ramps high enough to generate a voltage across R1 equal to the
drive level, the comparator output goes high, turning off the MOSFET. The voltage at
the junction of the MOSFET and the inductor then drops until D1 forward biases. The
current continues ramping down from its peak level toward zero. When the voltage across
the sense resistor R1 drops below the drive level, the comparator output goes low, the
MOSFET turns on and the cycle starts over.
R2 and C1 form a time-delay network that limits the switching speed of the driver and
causes it to slightly overshoot and undershoot the drive level when operating. The limit is
necessary to keep the switching speed low, so the MOSFET switches effi ciently. If R2 and
C1 were not present, the system would run at a speed set by the comparator propagation
delay and the switching speed of the MOSFET. At that speed, the switching time of the
MOSFET would be a signifi cant portion of the switching time and the switching effi ciency
of the MOSFET would be too low.
To design a PWM high current driver, fi rst determine a switching speed (FSWX) that is appropriate
for the system. Next, choose a MOSFET and D1 capable of handling the load current
requirements. Then choose values for R2 and C1 using Equation 2-1.
Next, determine the maximum ripple current that the load will tolerate and calculate the required
inductance value for L1 using Equation 2-2.
Equation 2-2:
L =
VDD - VLOAD
IRIPPLE * FSWX * 2
Finally, choose a value for R1 that will produce a feedback ripple voltage of 100 mV for the
maximum ripple current IRIPPLE.
Example:
• FSWX = 10 kHz, R2 = 22k, C1 = .01 µF
• IRIPPLE = 100 mA, VDD = 12V, VL = 3.5V
• L = 4.25 mH
R2 * C1
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
For more information visit www.microchip.com 10
TIP 3. Delta Sigma ADC
This tip describes the creation of a hardware/software based delta sigma ADC. A delta sigma
ADC is based on a delta sigma modulator composed of an integrator, a comparator, a clock
sampler and a 1-bit DAC output. In this example, the integrator is formed by R1 and C1. The
comparator is an on-chip voltage comparator. The clock sampler is implemented in software
and the 1-bit DAC output is a single I/O pin. The DAC output feeds back into the integrator
through R2. Resistors R3 and R4 form a VDD/2 reference for the circuit (see Figure 3-1).
Figure 3-1. Delta Sigma Modulator
R1 Comparator
R3 R4
VDD
Input
Software Data
R2
C1
Tips n’ Tricks - PICmicro® Microcontroller Comparators
In operation, the feedback output from the software is a time-sampled copy of the comparator
output. In normal operation, the modulator output generates a PWM signal which is inversely
proportional to the input voltage. As the input voltage increases, the PWM signal will drop
in duty-cycle to compensate. As the input decreases, the duty-cycle rises. To perform an
A-to-D conversion, the duty-cycle must be integrated over time, digitally, to integrate the duty
cycle to a binary value. The software starts two counters. The fi rst counts the total number of
samples in the conversion and the second counts the number of samples that were low. The
ratio of the two counts is equal to the ratio of the input voltage over VDD.
Note: This assumes that R1 and R2 are equal and R3 is equal to R4. If R1 and R2 are not
equal, then the input voltage is also scaled by the ratio of R2 over R1 and R3 must
still be equal to R4.
For a more complete description of the operation of a Delta Sigma ADC and example fi rmware,
see Application Note AN700 “Make A Delta Sigma Converter Using a Microcontroller’s Analog
Comparator Module “.
Example:
• R3 = R4 = 10 kHz
• R1 = R2 = 5.1k
• C1 = 1000 pF
TIP 4. Level Shifter
This tip shows the use of the comparator as a digital logic level shifter. The inverting input is
biased to the center of the input voltage range (VIN/2). The non-inverting input is then used for
the circuit input. When the input is below the VIN/2 threshold, the output is low. When the input
is above VIN/2, then the output is high. Values for R1 and R2 are not critical, though their ratio
should result in a threshold voltage VIN/2 at the mid-point of the input signal voltage range.
Some microcontrollers have the option to connect the inverting input to an internal voltage
reference. To use the reference in place of R1 and R2, simply select the internal reference and
confi gure it for one half the input voltage range.
Note: Typical propagation delay for the circuit is 250-350 ns using the typical on-chip
comparator peripheral of a microcontroller.
R2
VDD
R1
YA
Figure 4-1. Level Shifter
Example:
• VIN = 0 - 2V, VIN/2 = 1V, VDD = 5V
• R2 = 10k, R3 = 3.9k
For more information visit:
www.microchip.com/solutions_tipsntricks
For more information visit www.microchip.com 11
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
What’s New in Microchip Literature?
Click on a Document Title to view the document.
(Continued)
Type of Document Title of Document DS# Print/Web
Application Notes Amplifying High-Impedence Sensors - Photodiode Example 00951A Web
Thermistor Temperature Sensing with MCP6S2X PGA 00897B Web
Low-Cost Electric Range Control Using a Triac 00958A Web
Solder Refl ow Recommendation 00233D Web
Brochures Power-Managed PIC® Microcontrollers featuring nanoWatt Technology 30493B Printed/Web
Lead (Pb) - RoHS-Compliant Solutions 00961A Printed/Web
Data Sheets dsPIC30F3010/3011 70141A Web
2-Wire High- Accuracy Temperature Sensor (MCP9800) 21909B Web
Single-Ended, Rail-to-Rail, Low-Gain PGA (MCP6S91/2/3) 21908A Web
PIC18FXX8 41159D Printed
PIC16F818/819 39598E Web
PIC16F7X7 30498C Web
PIC18F6627/6722/86278722 39646A Web
Erratas dsPIC30F4011/4012 Rev. A2 Silicon Errata 80215A Web
MSSP Module Silicon/Data Sheet Errata 80131D Web
SSP Module Silicon/Data Sheet Errata 80132D Web
PIC16F818/819 Rev. A4 Silicon Errata 80159E Web
PIC16F818/819 Rev. B0 Silicon Errata 80212B Web
PIC16F7X7 Rev. A2 Silicon/Data Sheet Errata 80177D Web
PICmicro® 18C Family Reference Manual Errata 80214A Web
PIC16F87/88 Rev. B1 Silicon/Data Sheet Errata 80171F Web
Migration Document PIC18F458 to PIC18F4580 Migration 39661A Web
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
For more information visit www.microchip.com 12
Click on a Document Title to view the document.
What’s New in Microchip Literature?
Type of Document Title of Document DS# Print/Web
Misc. Documents Product Selector Guide (October thru December 2004) 00148J4 Web
Q2-2004 Reliability Report 00097T Web
Product Brief PIC18F6627/6722/86278722 Family 39627C Web
Reference Manual dsPIC30F Family Reference Manual 70046C Web
Sell Sheets PICDEM.net™ Internet/Ethernet Demo. Board 51240B Web
TC1046/1047/A Voltage Output Temperature Sensor 21638B Web
User Guides PICSTART™ Plus User’s Guide 51028F Web
dsPIC® Language Tools Getting Started 70094C Web
MPLAB® C30 C Compiler User’s Guide 51284B Web
dsPIC® Language Tools Libraries 51456B Web
Photodiode PGA PICtail™ Daughter Board User’s Guide (MCP6S22) 51514A Web
Thermistor PGA PICtail™ Daughter Board User’s Guide 51517A Web
MCP6S22 PICtail™ Demo. Board User’s Guide 51481A Web
The Microchip name and logo, the Microchip logo, dsPIC,MPLAB, PIC, PICmicro, PICSTART and PRO MATE are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
In-Circuit Serial Programming, ICSP, PICkit, PICDEM.net and PICtail are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. IrDA is a register mark of Infrared Data Association.
SPI is trademark of Motorola. I2C is a trademark of Philips Corporation. All other trademarks mentioned herein are property of their respective companies.
For more information visit www.microchip.com 13
MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - November 2004
DID YOU KNOW.....
� That device pages provide a quick and easy way to see the most recently updated
documents? All the related documents are listed in the right column, but the LEFT
column identifies the MOST RECENTLY UPDATED DOCUMENTS. As other documents
are updated, the old ones rotate out of this spot but you can still locate them on the right side.
Only the newest document will be displayed on the left. See example below.
web siteHIGHLIGHTS
For more information visit: www.microchip.com
Visit Microchip Technology’s user-friendly e-commerce site:
� Special offers on silicon and development systems
� Powerful parametric search tool
� Live inventory status
� Hassle-free buying
Figure 1. Home Page
buy.Microchip has expanded into
12 new countries in Asia and 10
new countries in Europe! Also,
many popular tape and reel as
well as tray parts have had their
minimum order quantities reduced
to just 1 part.
For more information visit: www.buy.microchip.com