microchip technology introduces battery charging products...

12
For more information visit www.microchip.com IN THIS ISSUE P AGE 1 Introducing, the MCP7384X battery charging product s P AGE 2 MCP2515 st and-alone controller added to family of CAN peripherals P AGE 3 PS700 battery management product s move into smaller mobile devices P AGE 4 - Switch Mode Power Supply Daughter Board - New addition to the PICDEM™ MSC1 Demo Board - PIC18F8680 CAN Controller p asses ISO/WD 16845 conformance test s P AGE 5 PICKit™ 1 Flash S t arter Kit, V1.30 now available P AGE 6 T O 9 “Debugging Microcontrollers” - Hint 4: “Basic T ilt Sensing using a MEMS” P AGE 10 Power Managed T ip s n’ T ricks: - Reading DIP Switches P AGE 1 1 - Product Success S tories with Microchip - University Corner P AGE 12 Microchip’ s Fab 4 host s 9/1 1 Memorial Microchip Technology Introduces Battery Charging Products that Maximize Battery Capacity and Life Cycle Safety Four devices offer feature sets to support most single-cell and dual-cell, Li-Ion and Li-battery charging applications. Figure 1. MCP73841 Typical Application Circuit These devices offer designers the flexibility to program the charge current and utilize an external Field Effect Transistor (FET), making them ideal for high capacity battery packs that require fast charging time. Microchip's MCP7384X devices automatically power-down when the input source is removed, minimizing the battery drain current. They also begin a new charge cycle when the battery voltage falls below the recharge threshold, thereby eliminating frequent trickle charge periods that are detrimental to the battery life. Additionally, the MCP7384X can withstand voltages as high as 12V from loosely regulated wall adapters, reducing total system cost. The MCP7384X are synergistic with many of Microchip's product lines, including PowerSmart ® product portfolio, DC/DC converters, line regulators and PICmicro ® microcontrollers with nanoWatt Technology for power management applications. The MCP7384X are ideal for the following applications: Wireless handsets, PDAs, digital cameras MP3 players, cellular phones Hand-held instruments, cradle chargers Digital cameras, MP3 players Li-Ion and Li-Polymer battery-powered equipment Microchip has introduced a family of single and dual cell Lithium-Ion (Li-Ion) and Lithium-Polymer (Li-Polymer) charge management controllers. These devices lead the industry with a voltage regulation accuracy of ±0.5 percent, enabling maximum cell utilization and enhancing the cycle life of the battery. Additionally, they provide safety features for low-cost, simple charging solutions. The MCP7384X Series Feature: Constant-voltage/constant-current regulation Cell preconditioning Cell temperature monitoring (MCP73841/2) Advanced safety timers Automatic charge termination Charge status indication Space-saving 10-pin MSOP packages (MCP73841, MCP73842) Temperature range of -40°C to 85°C High accuracy, preset voltage options: - 4.1V, 4.2V (MCP73841, MCP73843) - 8.2V, 8.4V (MCP73842, MCP73844) Input voltage range of 4.5V to 12V (MCP73841, MCP73843) Input voltage range of 8.7V to 12V (MCP73842, MCP73844) The cell preconditioning supports deeply depleted batteries. The cell temperature monitoring (in the MCP73841/2) continuously measures the cell temperature and prevents charging when the temperature is outside the recommended temperature range. The safety timers allow for time-based charge termination, which helps assure safety in the case of defective battery cells. For more information, contact any Microchip sales representative, authorized distributor or visit; www .microchip.com/solutionsmcp7384X V DD V SS V BAT DRV THERM EN SENSE 1 2 3 4 10 9 8 7 MCP73841 TIMER 5 6 STAT1 Voltage Regulated Wall Cube + - Battery Pack R SENSE C TIMER *Optional Reverse Blocking Diode THREF R T1 R T2 Q 1

Upload: others

Post on 10-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

For more information visit www.microchip.com

IN THIS ISSUEPAGE 1Introducing, the MCP7384Xbattery charging products

PAGE 2MCP2515 stand-alone controller added to family ofCAN peripherals

PAGE 3PS700 battery managementproducts move into smallermobile devices

PAGE 4- Switch Mode Power Supply

Daughter Board - New addition to the PICDEM™MSC1 Demo Board

- PIC18F8680 CAN Controllerpasses ISO/WD 16845 conformance tests

PAGE 5PICKit™ 1 Flash Starter Kit,V1.30 now available

PAGE 6 TO 9 “Debugging Microcontrollers”

- Hint 4: “Basic Tilt Sensingusing a MEMS”

PAGE 10Power Managed Tips n’ Tricks:

- Reading DIP Switches

PAGE 11 - Product Success Stories with

Microchip

- University Corner

PAGE 12Microchip’s Fab 4 hosts 9/11Memorial

Microchip Technology IntroducesBattery Charging Products thatMaximize Battery Capacity and LifeCycle SafetyFour devices offer feature sets to support most single-celland dual-cell, Li-Ion and Li-battery charging applications.

Figure 1. MCP73841 Typical Application Circuit

These devices offer designers the flexibility to program the charge currentand utilize an external Field Effect Transistor (FET), making them ideal forhigh capacity battery packs that require fast charging time.

Microchip's MCP7384X devices automatically power-down when the inputsource is removed, minimizing the battery drain current. They also begin anew charge cycle when the battery voltage falls below the rechargethreshold, thereby eliminating frequent trickle charge periods that aredetrimental to the battery life. Additionally, the MCP7384X can withstandvoltages as high as 12V from loosely regulated wall adapters, reducing totalsystem cost.

The MCP7384X are synergistic with many of Microchip's product lines,including PowerSmart® product portfolio, DC/DC converters, line regulatorsand PICmicro® microcontrollers with nanoWatt Technology for powermanagement applications.

The MCP7384X are ideal for the following applications:• Wireless handsets, PDAs, digital cameras • MP3 players, cellular phones • Hand-held instruments, cradle chargers • Digital cameras, MP3 players• Li-Ion and Li-Polymer battery-powered equipment

Microchip has introduced a family of single and dual cell Lithium-Ion (Li-Ion)and Lithium-Polymer (Li-Polymer) charge management controllers. Thesedevices lead the industry with a voltage regulation accuracy of ±0.5 percent,enabling maximum cell utilization and enhancing the cycle life of the battery.Additionally, they provide safety features for low-cost, simple chargingsolutions.

The MCP7384X Series Feature:• Constant-voltage/constant-current regulation• Cell preconditioning• Cell temperature monitoring (MCP73841/2)• Advanced safety timers• Automatic charge termination• Charge status indication• Space-saving 10-pin MSOP packages (MCP73841, MCP73842) • Temperature range of -40°C to 85°C • High accuracy, preset voltage options:

- 4.1V, 4.2V (MCP73841, MCP73843)- 8.2V, 8.4V (MCP73842, MCP73844)

• Input voltage range of 4.5V to 12V (MCP73841, MCP73843)• Input voltage range of 8.7V to 12V (MCP73842, MCP73844)

The cell preconditioning supports deeply depleted batteries. The celltemperature monitoring (in the MCP73841/2) continuously measures the celltemperature and prevents charging when the temperature is outside therecommended temperature range. The safety timers allow for time-basedcharge termination, which helps assure safety in the case of defectivebattery cells.

For more information, contact any Microchip sales representative,authorized distributor or visit;

www.microchip.com/solutionsmcp7384X

VDDVSS

VBAT

DRV

THERM

EN

SENSE 1

2

3

4

10

9

8

7

MCP73841TIMER

5 6

STAT1

VoltageRegulated Wall Cube

+-

BatteryPack

RSENSE

CTIMER

*Optional ReverseBlocking Diode

THREFRT1

RT2

Q1

Page 2: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

The MCP2515 is ideal for a number of applications:• Motor control• Airbag control• Remote sensors• Remote actuators• Remote valves• Instrument clusters• Security systems• Elevator systems• Medical equipment • Robotics

For more information, contact any Microchip sales representative, authorizeddistributor or visit:

For more information visit www.microchip.com 2

CAN Module

TX and RX Buffers Masks and Filters

Control Logic

Timing

Generation

Controland

InterruptRegisters

SPI™ Interface

Logic

RXCAN

TXCAN

SPI™

Bus

CSSCKSISO

OSC1OSC2

CLKOUT

CANProtocolEngine

INT

RX0BF

RX1BF

TX0RTS

TX1RTS

TX2RTS

RESET

Microchip Adds MCP2515 Stand-aloneController to its Family of PeripheralProducts!

In addition to microcontrollers withintegrated CAN ports, Microchipoffers peripherals designed toprovide flexible, cost-effectiveoptions for implementing complete CAN nodes.

The 18-pin, MCP2515 isMicrochip’s latest, easiest-to-use,most cost-effective, stand-alonecontroller on the market today. Itfeatures an industry standardSerial Peripheral Interface(SPI™), enabling an easy con-nection to virtually any microcon-

troller. CAN communication can be added to existing systems through the simpleSPI interface without requiring a complete system redesign. The MCP2515 is thesuccessor to Microchip’s first stand-alone CAN controller, the MCP2510. It is function and footprint compatible to the MCP2510 and provides additionalenhancements like faster throughput.

Key features of the MCP2515 stand-alone CAN controller are:• Small footprint• Simple SPI interface to any MCU• Full CAN 2.0B Active implementation• Minimizes MCU overhead requirements

– Multiple transmit and receive buffers– Masks and filters limit messages to be processed

• Buffered clock output• Data byte filtering capability

Figure 1. TC2515 Typical Application Circuit

www.microchip.com/solutionsmcp2515

Page 3: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

For more information visit www.microchip.com 3

Microchip’s PowerSmart® Battery ManagementProducts Move into Smaller Mobile Devices The PS700 delivers accurate battery parameters for capacitymonitoring of rechargeable Lithium Batteries

The PS700 battery monitor is thenewest member of the PowerSmartproduct family, focusing on 1-2 seriescell Lithium or 3-6 series cell Nickelchemistries.

This integrated device contains anadvanced 16-bit programmable A/Dconverter, which combined withadvanced firmware, can yield batterycapacity accuracy better than 1%error. The PS700 includes an internaltemperature sensor, two oscillators,512 bytes of EEPROM and utilizesstandard SMBus communication.

When using the PS700 in a single cell application, customers can use the secondary safetyfeatures, which include conditions for voltage, current or temperature.

The PS700 battery monitor provides precise battery information needed to calculate thebattery capacity. Targeted for hand-held and mobile products, the PS700 supports battery-operated products to extend system performance, while providing greater predictability ofuse. The device sets expectations of runtime, charge time and battery state of health;meanwhile, it accurately monitors and reports current operational conditions and status ofthe battery for use in system power management.

For flexibility during changing operating conditions, the A/D converter can be configured toprovide measurements of parameters such as voltage, current and temperature withresolutions of 9-16 bits. Battery information is provided to the host over an industry-standard SMBus interface while battery and user data is stored within the on-board 4K-bitEEPROM. The PS700 can utilize an on-board or external temperature sensor for use indetermining battery temperature. Designers using the PS700 have the ability to achieveprecise predictions of battery capacity and current operational conditions, which results inlonger runtime and better overall system-power management. In support of low-powerapplications, the PS700 operates in four different power modes. This device consumes lessthan 80 µA in run mode and less than 1 µA in sleep mode.

Batteries enabled with the PS700 can stop over-charge and over-discharge, predict runtime or time to charge and provide accurate, real-time battery information for use by thesystem or system user.

PackConnection

20 mOhms

RS

Li IonPrismatic+3.6VNominal

- +

S1698EDQ

B+

C

D

B-

PS700SCL

1

2

3

4 SDA

VC1

VC2/IO1 SR

GND

NTC/IO0

ROSC

8

7

6

5

SafetyIC

SENS VCC

ICT

VSS

VMCO

DO

For more information, contact any Microchip sales representative, authorized distributor orvisit:

www.microchip.com/solutionsps700

Figure 1. PS700 Application Block Diagram

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

Page 4: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

For more information visit www.microchip.com 4

Switch Mode Power Supply (SMPS)Daughter Board - New Addition to the PICDEM™ MSC1 Demontration Board

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

A new addition to the PICDEM MSC1 Demontration boardis the Switch Mode Power Supply or SMPS daughterboard. Designed to plug on top of the PICDEM MSC1, theSMPS daughter board allows designers to prototype thefour basic switch mode power supply topologies; Boost,Buck, Buck-Boost and Invert.

The Boost topology takes the 9V DC power supply andboosts it up to over 20V. The Buck topology can regulatethe 9V DC power supply down to almost 0V, with an efficiency of better then 80%. The Buck-Boost topologycombines the capabilities of the previous two, producing afull output voltage range of 0 and 20V. The Inverttopology generates the same voltage range as the Buck-Boost, but the voltages are negative. All four topolo-gies are selected by opening or shorting the five configu-ration jumpers on the daughter board.

The secret to the easy design of power supplies with the SMPS daughter board lies in the PICDEM MSC1GUI interface. Once the configuration jumpers are in place, the designer simply loads a GUI configuration filefor the selected topology and the PICDEM MSC1 automatically configures all the peripherals within thePIC16C782 for the topology selected. Output voltage control is also easy. Simply grab the DAC slider bar withyour mouse pointer and move it up and down. The power supply output voltage follows the DAC pointer'severy move.

All four topologies are implemented as simple hysteretic feedback designs, allowing the design of simple switchers that do not require the complexities of a PID feedback controller. But that doesn't mean thatthe daughter board is limited to simple designs. The PIC16C782 pins connected to its on-chip op amp areavailable to the prototyping area, therefore, if a more complex feedback control is needed, the SMPSDaughter board is capable of handling the design. Simply design the PID feedback controller required andimplement it using the on-chip op amp and a section of the generous prototyping area.

To order the PICDEM MSC1 Demonstration board; or the PICDEM MSC1 SMPS Daughter board; contactyour local Microchip distributor and request the following part numbers:

DM63012 PICDEM MSC1 AC163001 SMPS Daughter board

Other daughter boards available for the PICDEM MSC1 include;AC163002 PICDEM MSC1 High Power IR Driver Daughter boardAC163003 PICDEM MSC1 Delta-Sigma Analog-to-Digital Converter Daughter boardAC163004 PICDEM MSC1 Flow Rate Sensor Daughter board

For more information, contact any Microchip sales representative, authorized distributor orvisit:

www.microchip.com/solutionssmpsboard

PIC18F6680 CAN MicrocontrollerPasses Communication and Systems(C&S) Conformance/ISO TestsMicrochip’s PIC18F6680/8680 family ofhigh-performance, self-programmableFlash microcontrollers with the EnhancedCAN (ECAN) 2.0B active interface haveachieved conformance with the ISO/WD16845 standard, as tested by theCommunication and Systems (C&S) Groupin Germany.

The C&S Group was founded in 1995 andfully incorporated by the faculty ofComputer Science at the University ofApplied Science in Wolfenbuttel, Germany. The group specializes in testing andverifying communication protocols for usein the automotive and industrial automationapplications to ensure that manufacturers’products conform to the corresponding standards. The CAN protocol conformance test, definedas ISO/WD 16845, enables interchangeability of the CAN microcontroller.

"Receiving ISO conformance reflects Microchip’s commitment to open standards allowing ourcustomers to develop compatible products quickly and easily," said Dan Termer, Vice President ofthe Automotive Products Group for Microchip. "Today’s announcement reinforces the company’scontinuous efforts to deliver products that meet or exceed the automotive industry’s CANrequirements for automotive connectivity applications."

Most car makers expect this C&S testimonial before they allow any microcontroller to sit on theirCAN bus. The C&S ISO/WD 16845 test report has become a key deliverable, just like the datasheet, in support of design activity with Tier 1 suppliers and car makers. For example at VW,where PICmicro® microcontrollers are used in non-CAN applications, the VW Group hasrestricted usage of the microcontrollers in a CAN-based application until the device hassuccessfully passed the ISO/WD 16845 conformance tests.

PIC18F product line meets ISO W/D 16845 specificationTo date, all Microchip PIC18F CAN products meet ISO/WD 16845 specification. These devicesare: PIC18F248, PIC18F258, PIC18F448, PIC18F458, PIC18F6680, PIC18F6585, PIC18F8680,and PIC18F8585. Thus, our customers can select the best device for their CAN-basedapplication, ranging from 28-pin packages with 16 KByte of flash program memory, up to 80-pinpackages with 64 KBytes of Flash program memory. Plans to expand the CAN-based PICmicromicrocontrollers are underway. These future products are expected to comply to ISO DIS16845requirements.

For more information, contact any Microchip sales representative, authorizeddistributor or visit:

www.microchip.com/solutionsecansep03

Page 5: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

For more information visit www.microchip.com 5

PICkit™ 1 Flash Starter Kit V1.30, is Now Available

The PICkit™ 1 Flash Starter Kit V1.30 adds support for the two new additions to the 8- and14-pin Flash Microcontroller family, the PIC16F684 and PIC16F688. These are 2 Kw and 4 Kw versions of the currently supported devices and have additional features such as,ECCP or EUSART. In addition, MPLAB® IDE software now directly supports the PICkit 1Flash Starter Kit, starting with Version 6.30. Engineers now can directly program devices fromMPLAB IDE software instead of importing into the PICkit Starter Kit GUI. Both the PICkit™ 1Flash Starter Kit V1.30 and MPLAB V6.30 are available at www.microchip.com.

The PICkit 1 board combines a device programmer, demonstration features and a snap-off prototype board. Engineers can write programs with MPLAB software, program the deviceand test it out all on the same board. The PICkit™ 1 Flash Starter Kit also includes 7 tutorials, complete with explanation and source code in both C and assembly.

Complete PICkit design details are included in the package. This includes board schematics,source code for both the PIC16C745 firmware and the PICkit host application.

The PICkit™ 1 Flash Starter Kit has recently been used in conjunction with Microchip’sCorporate Seminars, Workshop-in-a-Box and several successful MASTER's classes.

The PICkit™ 1 Flash Starter Kit has also been used as the basis for many other projects suchas the Presentation Pal which allows presenters to advance PowerPoint® slides via remotecontrol. Modified PICkit firmware enumerates as a keyboard. When the signal from the transmitter is pressed, it sends the keycodes to advance the presentation. The completesolution is included in the rfPIC™ Development Kit 1 (DV164102).

Sales continue on a record-setting pace as thousands of engineers use PICkit 1 to familiar-ize themselves with Microchip's product offerings. Future PICkit™ 1 Flash Starter Kit releases are exepcted to further expand support for the growing family of 8- and 14-pin mid-range Flash devices with new features.

For more information, contact any Microchip sales representative, authorized distributoror visit:

www.microchip.com/solutionspickit1

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

Note: Silicon not yet introduced.

Page 6: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

For more information visit www.microchip.com 6

4Hint Basic Tilt Sensing Using a MEMSThe following technical article is the fourth in a series of “Hints” reprinted by permission from the Agilent Technologies’ Test & Measurement Group’s publication, “5 Hints for Debugging Microcontroller-based Designs.”

Micro-Electro-Mechanical System (MEMS)accelerometers are used in diverse applica-tions such as automotive airbag systems,computer disk drives and home appliances.Newer accelerometers, such as the AnalogDevices ADXL202E, are so sensitive thataccurate tilt sensing is now possible as well.This example examines the implementationof a level sensor using a PIC16F873 fromMicrochip Technology Inc. and anADXL202E. Testing and calibration will beperformed using an Agilent 54642D mixedsignal oscilloscope (MSO).

Level Sensor ConceptsThe ADXL202E is a ±2g dual-axisaccelerometer with duty-cycle outputs for theX- and the Y-axes. For the sake of clarity, wewill describe only one axis in detail, but keepin mind that both axes are measured and calibrated in precisely the same way.

At 0 g, the output will typically be at 50%duty cycle. This is usually referred to as the0 g bias level. The duty cycle will changeapproximately 12.5 percent per applied g,depending on which way an axis is tilted.This value is referred to as the sensitivity.The period of the ADXL202E is adjustableand can be set from 0.5 to 10 ms,depending on the application. A typicaloutput and a rough formula for accelerationare shown below.

T2

T1

Ax(g) =

Tx1T2

x 100 – 50

12.5

Ay(g) =

T1yT2

x 100 – 50

12.5

The acceleration can be converted to degrees of tilt as follows:

Pitch = arcsin(Ax/1g)

Roll = arcsin(Ay/1g)

Basic CalibrationThe world isn't a perfect place. It turns out in practice thatthe 0 g bias level and the sensitivity both vary from theirideal values. Furthermore, these two parameters areVERY temperature dependent, but for now we willassume that our system will stay at room temperature.

The acceleration equation is better written as:

A(g) =

T1yT2

x 100–(0g_Bias(%))

Sensitivity(%)

Basic CalibrationPlacing the accelerometer so that both of its axes are parallel to the surface of the earth, the 0 gbias levels can be recorded. The 0 g bias levels of our test board are shown in Figure 1.

Using gravity as a reference, the device can then be rotated to find the minimum and maximumduty cycles for each axis:

Sensitivity(%) = MaxDC(%)–MinDC(%)

2

Figure 1. The 0 g biaslevels of the test board.

(CONTINUED ON NEXT PAGE)

X: 0 g bias = 47.8%, Y: 0 g bias = 51.5%

Page 7: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

For more information visit www.microchip.com 7

4Hint Basic Tilt Sensing Using a MEMS (Continued)

Sensitivity Scope Captures

Figure 2 a. X-axis sensitivity (Min and Max X duty cycles, Y at 0 g)

Figure 2b. Y-axis sensitivity (Min and Max X duty cycles, X at 0)

0 g DC Min DC Max DC Sensitivity

X-Axis 47.8 % 34.8% 60.4% 12.8%Y-Axis 51.5 % 39.0% 63.9% 1.4%

Measured Values

Example: 30-degrees rollFor a quick example, our test board is “rolled” 30 degrees to the left.The result is shown in Figure 3.

Figure 3. Results of “rolling” the test board 30 degrees to the left.

Pitch = arcsin = 0˚[47.8%–47.8%]

12.8%

Roll = arcsin = –29.3˚ [45.4%–51.5%]

12.45%

(CONTINUED ON NEXT PAGE)

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

Page 8: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

For more information visit www.microchip.com 8

4Hint Basic Tilt Sensing Using a MEMS (Continued)

Circuit and FirmwareFigure 4 is a basic block diagram of the PIC16F873/ADXL202E/MSO setup. The PIC16F873 is an idealmicrocontroller for this application due to its internal counters and EEPROM for storing calibration constants.Also included in this diagram is an LM35 temperature sensor from National Semiconductor®. It outputs 10 mV/°C and will be used for a later example.

Figure 4. Basic diagram of the test setup.

U1 PIC16F873-201/P

RC1/T1OSI/CCP2

RC2/CCP1

RA3/AN3/VREF+

12 5

13 4

11

3

15

1

8

3

7

2

6

+5V

C30.1 µF

+5 V

Analog 0Temperature

Vcc

OutGND

U2

LM35ADXL202

U3

Xout

Yout

Self Test

Y1

X1

D0 Xout D1 Yout

Vdd

COM

Xtilt

Ytilt

T2

C4 0.1 µF

C5 0.1 µF

1.00 M

R5

249 K

R6

R3 47

Test Test

Test

The job of the PIC® microcontroller is to watch for rising and falling edges on the Xout and Youtlines. On the rising edges, the internal counters can be reset to zero and will count until a fallingedge is received. The interval between the rising and falling edge will be “T1”, while the intervalbetween the rising edges will be the period, or “T2”.

Very simple code to monitor the X-axis.

float X_Deg(void){

// Measure High pulse width and period of X levelsetup_ccp1(CCP_OFF); // Disable CCP1 (Y input)setup_ccp2(CCP_CAPTURE_RE); // Configure CCP2 to capture rise

CCP2IF=0; // Clear CCP2 Flagwhile (!CCP2IF); // Wait for rising edgeset_timer1(0); // Clear Timer1setup_ccp2(CCP_CAPTURE_FE); // Capture Fall, Clear Timer1CCP2IF=0; // Clear CCP2 Flagwhile (!CCP2IF); // Wait for falling edgepos_pulse = CCP_2; // Record pulse widthsetup_ccp2(CCP_CAPTURE_RE); // Capture rise,CCP2IF=0; // Clear CCP2 Flagwhile (!CCP2IF); // Wait for rising edgeperiod = CCP_2; // Record periodsetup_ccp2(CCP_OFF); // Disable CCP2 (X input)duty_cycle = (100 * pos_pulse / period) ;

FB_Angle = (180/3.14159) * asin( (duty_cycle - EEPROM_Read_Float(X_Zero_DC)) /EEPROM_Read_Float(X_Sensitivity) );

return FB_Angle;}

Note: 0 g bias and sensitivity points are already stored in EEPROM. FB_Angle andduty_cycle are floating point numbers; pos_pulse and period are 16-bit integers.

The floating point result is returned in FB_Angle and now it is up to the application todetermine what to do with it.

(CONTINUED ON NEXT PAGE)

Page 9: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

For more information visit www.microchip.com 9

4Hint Basic Tilt Sensing Using a MEMS (Continued)

Checking Temperature DependenceAs briefly mentioned before, the 0 g bias point of the ADXL202E is temperature dependent.Figures 5 - 7 show examples where the only thing that changes is the temperature.

As you can see, the X-axis is more sensitive to temperature than the Y-axis. If your applicationhas to work over a wide temperature range and maintain fine accuracy, temperature compensation will be necessary.

Using Deep MemoryThe Agilent oscilloscope eases testing with its mixed signal capabilities and deep memory. Byusing the deep memory, it is possible to capture hundreds of output cycles and get a rough ideaof the sensor’s transient response. In a real-world system, the oscilloscope could also simultaneously monitor several other inputs and outputs to determine system timing.

Click here for additional information on the Agilent 54642D or information on the PIC16F873

Figure 5.The 0 g bias when theroom temperature is 269 mv/10mv/C => 27°C

Pitch = arcsin = 0˚ [47.8%–47.8%]

12.8%

Roll = arcsin = 0˚ [51.5%–51.5%]

12.45%

Figure 6. The 0 g bias when the room temperature is 383 mv / 10 mv/C => 38C°

Figure 7. The 0 g bias when the room temperature is 501 mv / 10 mv/C => 50C°

Pitch = arcsin = 0.9˚ [48.0%–47.8%]

12.8%

Roll = arcsin = –0.5˚ [51.4%–51.5%]

12.45%

Pitch = arcsin = 3.13˚ [48.5%–47.8%]

12.8%

Roll = arcsin = –0.5˚ [51.4%–51.5%]

12.45%

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

Page 10: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

For more information visit www.microchip.com 10

Power-Managed Tips n’ Tricksfor PIC® Microcontrollers

Reading DIP Switches

PIC12F6XX

GP0

GP1

GP2

GP3

GP5/T1CKI

10K

VDD

GP4Data I/O

The input of a timer can be used totest which switch(s) is closed. Theinput of Timer 1 is held high with apull-up resistor. Sequentially, eachswitch I/O is set to input and Timer1 is checked for an increment indicating the switch is closed.

Each bit in the DP register represents its corresponding switchposition. By setting Timer 1 toFFFFh and enabling its interrupt,an increment will cause a roll-overand generate an interrupt. This willsimplify the software by eliminatingthe bit test on the TMR1L register.

Sequentially set each GPIO to aninput and test for TMR1 increment(or 0 if standard I/O pin is used). www.microchip.com/solutionstipstricksseptember03

For additional information, contact any Microchip sales representative or authorizedworldwide distributor, or visit:

movlw b'11111111'movwf TRISIOmovwf DIPmovlw b'00000111'movwf T1CONmovlw b'11111110'movwf Maskclrf GPIO

LOOPclrf TMR1Lmovf Mask,Wmovwf TRISIObtfsc TMR1L,0andwf DIP,Fbsf STATUS,Crlf Mask,Fbtfsc Mask,4goto Loopretlw 0

Page 11: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

For more information visit www.microchip.com 11

Microchip Product Success StoriesShare Your Microchip Product Success Stories On-Line!Do you have a Success Story using Microchip products that you've been waiting to sharewith the rest of the engineering community? If so, please click on the link below to learn howto post your story. It's easy and it's a great way to share your knowledge of Microchip products. Your story could be just what your colleagues have been waiting for prior to takingtheir design into full production. Don't wait, start sharing your success stories today!

The following are samples of product success stories that have been submitted to our web site.

Success Story Using Microchip's PICDEM.net™ Demo Board and PIC18F452

As a senior electrical engineering student at Case Western Reserve University in Cleveland, Ohio, two semesters of senior project lab are required for graduation. My team purchased the PICDEM.net™Demo Board from Microchip, using it to develop an embedded ethernet for a data acquisition system.We connected an RTD to the PIC18F452’s A/D input pin and used the on-board web pages to display current temperature readings. Additionally, we wrote a MFC application to query the PICDEM.net™demo board and populate a Microsoft® Access 2002 database with returned values.

Our technical advisor nominated our team for a competition named, ‘The Best Senior ProjectCompetition 2002-2003.’ Philips Medical took part in judging the competition. Using the PICDEM.net ™demo board, the embedded ethernet team took second place out of a total of ~35 projects. WithoutMicrochip’s demo board, the project’s final functionality could not have been completed within theassigned schedule. Many thanks are due to the developers of the PICDEM.net™ demo board and toJeremy Bentham, author of ‘TCP/IP Lean.’

Patrick, Co-op StudentRockwell Automation

Success Story Using Microchip's PIC12C508

One year ago, my company was asked to develop a low priced electronic control to drive a low powermotor. The specs of this project were as follows: read a sensor; detect the speed; determine the direction of rotation; provide low-power consumption; provide space for the PCB and prevent the powerdevice from overheating if the rotating motor were to break.

To satisfy all of these requirements, I decided to select the PIC12C508. It’s a low-priced, 8-bit processorthat contained all of the necessary peripherals I needed for my design. All this and I didn’t have to usean interface to drive the power devices. It has been difficult to write the program because I’m handling more than one real time event without using an external interrupt function. But thanks to thequantity of application notes and great technical support provided by Microchip, I have reached my goal.

Now I can say that my design is one of the best electronic motor controls available. Since I was able touse the PIC12C508, my product has become one of the lowest priced devices on the market.

Diacono, EAC of CESET

University CornerMICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

Oklahoma Christian University, OK

Team DV8, a senior design team under the guidance of Associate Professor, David Waldo,used the PIC18F452 for their line-following robot, which competed in the IEEE Region 5robot contest. Their robot was the only one of 30 robots that used a camera and thePICmicro® MCU was used for the motor controller for one DC motor, which used a closedloop PID algorithm to control the motor's speed.

T o learn how to post your Success Stories visit:

www.microchip.com/solutionssuccessstoriessep03

Page 12: Microchip Technology Introduces Battery Charging Products ...ww1.microchip.com/downloads/en/Market_Communication/sep03_m… · SPI interface without requiring a complete system redesign

MICROCHIP TECHNOLOGY’S MICROSOLUTIONS eNEWSLETTER - SEPTEMBER 2003

For more information visit www.microchip.com 12

Microchip’s Fab 4 in Gresham, Oregonto Host 9-11 MemorialBy Mark Garber, Courtesy of “The Gresham Outlook”

Staff photo by Flint CarltonThe location has changed andthe backup troops havearrived, but the intent remainsthe same to remember morethan 3,000 people who diedon Sept. 11, 2001.

Gresham, Oregon residentKelly Broomall has worked formonths to organize a “healingfield” in east county to commemorate the secondanniversary of the Sept. 11terrorist attacks. Based on asimilar memorial in Sandy,

Utah, Broomall had envisioned a sea of flags - with each banner representing one of the people who died in the attacks.

All of Broomall’s efforts, however, could have been in vain if not for the cooperation of oneof Gresham’s newest corporate citizens - Microchip Technology Inc.

Microchip stepped in after it appeared that no suitable site could be found for the event.Broomall and other organizers had looked at dozens of east county sites and even settled on the Townsend Farm property in Fairview.

But the farm site had constraints, such as the need to plant grass, that could not beaddressed in a matter of a few weeks. Broomall was about to call it quits, and he contactedGresham Mayor Charles Becker, a supporter, to give him the bad news. “I’m going to haveto pull the plug,” Broomall told the mayor. “I really can’t do this in good conscience, becauseI can’t assure the outcome.”

Becker asked Broomall for a day or two to work on the issue. City Manager Rob Fussell thengot in touch with Robert Lloyd, vice president of site services and facilities management forMicrochip.

Lloyd talked it over with other Microchip managers, and they quickly agreed to allow nearly3,500 flags to be planted in the front lawn of the plant on Southeast Stark Street.

“They stepped up to the plate and hit a homerun,” Broomall says of Microchip. Lloyd said theHealing Field idea fit with Microchip’s corporate culture.

“We think it’s a wonderful project,” he said. “It fits right in with everything we do.”

Broomall also is getting help from the Tribute to Honor organization, a non-profit group thatrecognizes firefighters and police officers. And the city of Gresham has contracted with localresident Sandy Bauer to coordinate the flag display and ceremony.

The flags will fly on 3.5 acres at Microchip on Sept. 11, 12, 13 and 14.

Two fields will contain flags remembering the civilians who died in the terrorist attacks.Another field will be set up to honor the police, fire and medical personnel who were killed.And a third field will represent those in the military who have been killed in the war on terrorism.

“It’s going to be huge,” said Matt Ulricksen, spokesman for Tribute to Honor. “It’s going to bea healing field.”

Two ceremonies will be held on Sept. 11, featuring patriotic music, prayers and speechesfrom police, fire and military representatives. Katie Harman, former Miss America, hasagreed to sing the national anthem. (Details of the program will be printed in The Outlook onWednesday, Sept. 10.)

After the flags are taken down, they will be sold to local residents, and proceeds will go tocharitable causes. Forms to purchase the flags are available at MBank, The Gresham Outlook and the Gresham Area Chamber of Commerce.

Reporter Mara Stine contributed to this story.

© 2003 Microchip Technology Incorporated. All rights reserved. The Microchip name and logo, PIC, PICmicro,PowerSmart and MPLAB are registered trademarks of Microchip Technology Inc. in the USA and other countries.PICDEM, PICDEM.net, PICkit and rfPIC are trademarks of Microchip Technology. SPI is a trademark of Motorola. All other trademarks mentioned herein are the property of their respective owners.