Microchip Technology PICDEM™ Mechatronics Demonstration Board User’s Guide

PICDEM™ Mechatronics
Demonstration Board
User’s Guide
© 2006 Microchip Technology Inc. DS51557C
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digit al Millennium Copyright Act. If suc h a c t s allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device applications and t he lik e is provided only for your convenience and may be su perseded by upda t es . It is y our responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life supp ort and/or safety ap plications is entir ely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless M icrochip from any and all dama ges, claims, suits, or expenses re sulting from such use. No licens es are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, K
EELOQ, microID, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active Thermistor, Mindi, MiWi, MPASM, MPLIB, MPLINK, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartT el, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology I ncorporat ed in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their respective companies.
© 2006, Microchip Technology Incorporated, Pr inted in the U.S.A., All Rights Reserved.
Printed on recycled paper.
Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona, Gresham, Oregon and Mountain View, California. The Company’s quality system processes and procedures are for its PICmicro EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
®
8-bit MCUs, KEELOQ
®
code hopping devices, Serial
DS51557C-page ii © 2006 Microchip Technology Inc.
PICDEMTM MECHATRONICS
DEMO BOARD USER’S GUIDE
Table of Contents
Preface ........................................................................................................................... 1
Chapter 1. PICDEM™ Mechatronics
1.1 Introduction .....................................................................................................7
1.2 Highlight s ......... ............. .. .. ........................... .. .. ........................... .. .. ................ 7
1.3 Quick Star t G u id e .................... .. ..................................................................... 8
1.4 PICDEM™ Mechatronics Development Kit Contents ...................................10
1.5 PICDEM™ Mechatronics Layout ..................................................................10
1.6 Required Tools .............................................................................................12
1.7 PICDEM™ Mechatronics Setup ...................................................................12
1.7.1 Jumper Settings ........................................................................................12
1.7.2 Board Power-Up ........................................................................................12
1.8 General PICDEM™ Mechatronics Demonstration Board Information ..........14
1.8.1 Experimentation ........................................................................................14
1.8.2 On-Board Status LEDs ..............................................................................14
1.8.3 Over-Current Protection Circuit ................................................................. 15
1.8.4 Motor Connection ...................................................................................... 15
1.8.5 Serial Communication ............................................................................... 15
1.8.6 Snap-Off Sensors ...................................................................................... 16
1.8.7 Back EMF Scaling Resistors ....................... ....................................... ....... 16
1.8.8 Current Sense ...........................................................................................16
1.8.9 Header/Jumper Functions ......................................................................... 17
Chapter 2. Example Projects
2.1 Introduction ...................................................................................................19
2.2 Loading Projects in MPLAB
2.3 Example Pr o je c ts ........... .. ........................... .. .. .............. .. .. ............. .. ... ......... 20
2.3.1 Project 1: Hello World (Light a LED) ....................................................................... 21
2.3.2 Project 2: Dusk Indicator Using the Voltage Comparator ........................................ 23
2.3.3 Project 3: Thermometer Using the Analog-to-Digital Converter ..............................25
2.3.4 Project 4: Digital Clock Using Timer1 .....................................................................27
2.3.5 Project 5: Brushed DC Motor Speed Control with Optical Encoder Feedback ....... 29
2.3.6 Project 6: Brushed DC Speed Control with Back EMF Feedback ..........................32
2.3.7 Project 7: Stepper Motor Control: Single Stepping, Half Stepping and
Microstepping ..................................................................................................... 35
2.3.8 Project 8: PC Interface Using the USART ..............................................................39
2.3.9 Project 9: Brushed DC Motor Control Using the ECCP ..........................................42
Chapter 3. Troubleshooting
3.1 Introduction ...................................................................................................47
3.2 Common Pr o b le m s ......... .................................................................. ... .. ....... 47
3.2.1 VDD Is Below 5V ........................................................................................47
3.2.2 No Voltage On Drive Stage .......................................................................47
®
IDE ................................................................. 20
© 2006 Microchip Technology Inc. DS51557C-page iii
PICDEMTM Mechatronics Demo Board User’s Guide
3.2.3 FAULT LED Stays On Or Continues To Trip When SW5 Is Pressed ........47
3.2.4 Microcontroller Does Not Run After Programming By The MPLAB
ICD 2 ......................................................................................................48
3.2.5 Back EMF At J16 Is Floating ......................................................................48
3.2.6 Board Is Non-Functional When Microcontrollers Are Installed In Both
U1 And U2 .............................................................................................48
3.2.7 Optical Interrupter Is Not Providing The Expected Feedback ....................48
3.2.8 Serial Communication Does Not Appear To Be Working ..........................48
Appendix A. Hardware Schematics
A.1 Introduction ..................................................................................................49
Appendix B. LCD Segment Mapping Worksheet
B.1 Introduction ..................................................................................................57
Worldwide Sales and Service .....................................................................................60
DS51557C-page iv © 2006 Microchip Technology Inc.
PICDEMTM MECHATRONICS
DEMO BOARD USER’S GUIDE

Preface

NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number. The numbering convention for the DS number is “DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the document.
For the most up-to-date information on development tools, see the MPLAB Select the Help menu, and then Topics to open a list of available on-line help files.
INTRODUCTION
®
IDE on-line help.
This chapter contains general information about this user’s guide and customer support that will be useful prior to using the PICDEM™ Mechatronics development kit. Items discussed in this chapter are:
• Document Layout
• Conventions Used in this Guide
• Warranty Registration
• Recommended Reading
• The Microchip Web Site
• Development Systems Customer Notification Service
• Customer Support
• Document Revision History
• Troubleshooting
© 2006 Microchip Technology Inc. DS51557C-page 1
PICDEMTM Mechatronics Demo Board User’s Guide
DOCUMENT LAYOUT
This document describes how to use the PICDEM™ Mechatronics Demonstration Board. The manual layout is as follows:
Chapter 1: PICDEM Mechatronics – An overview of the PICDEM Mechatronics Demo Board. PCB layout, parts and how to connect the provided jumper wires to the board.
Chapter 2: Example Projects – Projects that describe how to read the sensors on the board, drive the LCD and control several motors. These motors include a Brushed DC (BDC) motor and a bipolar stepper motor.
Chapter 3: Troubleshooting – Provides resolutions for solving common problems associated with using the PICDEM Mechatronics Demo Board.
Appendix A: Hardware Schematics – Illustrates the PICDEM Mechatronics Demo Board hardware schematic diagrams.
Appendix B: LCD Segment Mapping Worksheet – Provides the LCD Segment Mapping Worksheet.
DS51557C-page 2 © 2006 Microchip Technology Inc.
CONVENTIONS USED IN THIS GUIDE
This manual uses the following docum entat io n conven tion s:
DOCUMENTATION CONVENTIONS
Description Represents Examples
Code (Courier font):
Plain characters Sample code
Filenames and paths Angle brackets: < > Variables <label>, <exp> Square brackets [ ] Optional arguments MPASMWIN [main.asm] Curly brackets and pipe
character: { | } Lowercase characters i n
quotes Ellipses... Used to imply (but not show) addi-
0xnnn A hexadecimal number where n is a
Italic characters A variable argument; it can be either a
Interface (Arial font):
Underlined, italic text with right arrow
Bold characters A window or dialog button to click OK, Cancel Characters in angle
brackets < >
Documents (Arial font):
Italic characters Referenced books “MPLAB
Choice of mutually exclusive argu-
ments; An OR selection
Type of data filename
tional text that is not relevant to the
example
hexadecimal digit
type of data (in lowercase characters)
or a specific example (in uppercase
characters).
A menu selection from the menu bar File > Save
A key on the keyboard <Tab>, <Ctrl-C>
Preface
#define START c:\autoexec.bat
errorlevel {0|1}
list
list_option...,
[
list_option]
0xFFFF, 0x007A
char isascii (char, ch);
®
IDE User’s
Guide”
© 2006 Microchip Technology Inc. DS 51557C-page 3
PICDEMTM Mechatronics Demo Board User’s Guide
WARRANTY REGISTRATION
Please complete the enclosed Warranty Registration Card and mail it promptly. Sending in your Warranty Registration Card entitles you to receive new product updates. Interim software releases are available at the Microchip web site.
RECOMMENDED READING
It is recommended that you become familiar with the documents listed below, prior to using the PICDEM Mechatronics Demo Board.
PICkit™ 2 Microcontroller Programmer User’s Guide (DS51553)
Consult this document for instr ucti ons on how to use the PICkit2 Microcontroller Programmer hardware and software.
MPLAB
Consult this document for information pertaining to Microchip’s In-Circuit Debugger, MPLAB ICD 2. MPLAB ICD 2 utilizes the in-circuit debugging capability built into the Flash devices.
PIC16F91X Data Sheet (DS41250)
Consult this document for information regarding the PIC16F91X 28/40/44-pin Flash-based, 8-bit CMOS Microcontroller with LCD Driver device specifications.
PIC16F631/677/685/687/689/690 Data Sheet (DS41262)
Consult this document for information regarding the PIC16F631/677/685/687/689/690 20-pin Flash-based, 8-bit CMOS Microcontroller device specifications.
PIC12F508/509/16F505 Data Sheet (DS41236)
Consult this document for information regarding the PIC12F508/509 8/14-pin Flash-based, 8-bit CMO S Micr oc ont ro ll er devi ce spec ifi ca tio ns .
MPLAB
Consult this document for more information pertaining to the installation and features of the MPLAB Integrated Development Environment (IDE) Software.
Mechatronics Design Center
The Mechatronics Design Center (www.microchip.com\mechatronics) provides a wealth of information on design applications involving Mechatronics. All documentation is in Adobe
®
ICD 2 In-Circuit Debugger User’s Guide (DS51331)
®
IDE, Simulator, Editor User’s Guide (DS51025)
®
Acrobat® (pdf) format.
DS51557C-page 4 © 2006 Microchip Technology Inc.
Preface
THE MICROCHIP WEB SITE
Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers. Accessible by using your favorite Internet browser, the web site contains the following information:
Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software
General Technical Support – Frequently Asked Questions (FAQs), technical support requests, online discussion groups, Microchip consultant program member listing
Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives
DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip’s customer notification service helps keep customers current on Microchip products. Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest.
To register, access the Microchip web site at www.microchip.com, click on Customer Change Notification and follow the registration instructions.
The Development Systems product group categories are:
Compilers – The latest information on Microchip C compilers and other language tools. These include the MPLAB C18 and MPLAB C30 C compilers; MPASM™ and MPLAB ASM30 assemblers; MPLINK™ and MPLAB LINK30 object linkers; and MPLIB™ and MPLAB LIB30 object librarians.
Emulators – The latest information on Microchip in-circuit emulators. This includes the MPLAB ICE 2000 and MPLAB ICE 4000.
In-Circuit Debuggers – The latest information on the Microchip in-circuit debugger, MPLAB ICD 2.
MPLAB Integrated Development Environment for development systems tools. This list is focused on the MPLAB IDE, MPLAB SIM simulator, MPLAB IDE Project Manager and general editing and debugging features.
Programmers – The latest information on Microchip programmers. These include the MPLAB PM3 and PRO MATE Plus and PICkit
®
IDE – The latest information on Microchip MPLAB IDE, the Windows®
®
development programmers.
II device programmers and the PICSTART®
© 2006 Microchip Technology Inc. DS 51557C-page 5
PICDEMTM Mechatronics Demo Board User’s Guide
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
• Development Systems Information Line Customers should contact their distributor, representative or field application engineer
(FAE) for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document.
Technical support is available through the web site at: http://support.microchip.com
DOCUMENT REVISION HISTORY
Revision A (May 2005)
• Initial Release of this Document.
Revision B (June 2005)
• Changed PIC® Communicator to PIC® MCU Communicator.
Revision C (September 2006)
• Changed AN0 to C1-
• Changed J2 to J1
• Changed J12 to J13
TROUBLESHOOTING
See Chapter 3 for information on common problems.
DS51557C-page 6 © 2006 Microchip Technology Inc.
Chapter 1. PICDEM™ Mechatronics

1.1 INTRODUCTION

The PICDEM™ Mechatronics is intended to be a learning tool for individuals interested in Mechatronic design. Mechatronics refers to integrating electronic controls into mechanical systems or replacing mechanical components with an electronic solution.
PICmicro size, high efficiency, speed and abundance of peripheral configurations. Mechatronic systems range in complexity from a simple electromechanical switch with output multiplexing to the complex stabilizer control of a supersonic jet. The appliance and automotive markets are notable markets in which mechatronic designs are becoming more common place. The modern washing machine, for instance, once an entirely mechanical design, incorporates microcontrollers to manage cycle times, read human inputs and regulate the speed of the agitate and spin cycles.
This chapter introduces the PICDEM™ Mechatronics development board. It describes the PCB layout, parts and electrical connection to the PICkit™ 2 Flash Programmer and MPLAB ICD 2 In-Circuit Debugger.
PICDEMTM MECHATRONICS
DEMO BOARD USER’S GUIDE
®
microcontrollers are ideal for use in Mechatronic systems due to their small

1.2 HIGHLIGHTS

This chapter discusses:
• Quick Start Guide
• The PICDEM™ Mechatronics Development Kit Contents
• The PICDEM™ Mechatronics Layout
• Required Tools
• PICDEM™ Mechatronics Setup
• General PICDEM™ Mechatronics Information
© 2006 Microchip Technology Inc. DS51557C-page 7
PICDEMTM Mechatronics Demo Board User’s Guide

1.3 QUICK START GUIDE

The PICDEM Mechatronics Demo Board is programmed at the factory with a demonstration program. The board must be configured as described in this chapter in order to use the demonstration program. Once the board is configured and powered up, the speed of the Brushed DC (BDC) motor on the board may be varied using the potentiometer (POT1). The 8-bit hexadecimal interpretation of the position of POT1 is displayed on the LCD.
Board Setup
Using the provided wire jumpers, screwdriver and shunts (2-pin black hard plastic jumpers), configure the board as shown in Figure 1-1.

1. Attach the leads of the Brushed DC motor to Drive 1 and Drive 2 using the screwdriver.

2. Connect POT1 (on J4) to C1- (on J13) using a wire jumper.

3. Connect P1 (on J1) to RD7 (on J10) using a wire jumper.

4. Connect N2 (on J1) to RD2 (on J10) using a wire jumper.

5. Connect the right and center pins on JP8 using a shunt.

Board Power-Up
Supply power to the board in one of the following ways:
• Connect a 9-12 V
• Connect a 9-12 V
terminals.
• Connect a 9 V
• Connect a 5 V
Note:
The power supply part number is AC162039 (see buy.microchip.com). Packaged with the MPLAB ICD 2, the part number is DV164007.
DC (0.75 amp minimum) supply using J9 (see note below) DC (0.75 amp minimum) supply to the P21 and P20 screw
DC battery to the battery connector. DC (1.2 amp minimum) supply to TP2 or TP3.
Demonstration Program
Press CLR FAULT (SW5), which is near the bottom right corner of the board. Turn POT1 clockwise to increase the speed of the motor. Note that the number displayed on the LCD increases as you turn the potentiometer clockwise.
Try experimenting with the other sensors on the board:
• Move the jumper wire on POT1 (J4) to Light (J4). Vary the intensity of light shining
on the light sensor located near the top left corner of the board. Notice what happens to the motor.
• Move the jumper to TEMP (J4). Blow on the temperature sensor located on the
top left corner of the board. Note what happens to the number displayed on the LCD.
• Move the jumper back to POT1. Move the jumper from N2 (J1) to D0 (J14). Watch
what happens to the intensity of LED D0 as you turn the potentiometer.
DS51557C-page 8 © 2006 Microchip Technology Inc.
PICDEM™ Mechatronics

FIGURE 1-1: QUICK BOARD SETUP

TM
© 2006 Microchip Technology Inc. DS 51557C-page 9
PICDEMTM Mechatronics Demo Board User’s Guide

1.4 PICDEM™ MECHATRONICS DEVELOPMENT KIT CONTENTS

The PICDEM™ Mechatronics Development Kit contains the following items:

1. The PICDEM™ Mechatronics Printed Circuit Board (PCB) with motors

2. Pre-programmed PIC16F917 PICmicro

3. 10 wire jumpers

4. 8 2-pin shunts

5. CD-ROM including:

PICDEM™ Mechatronics User’s Guide
Workshop-in-a-Box presentation for training students on the board
(speaker notes included)
Data sheets for the PIC16F91X, PIC16F631/677/685/687/689/690
and motors
Application notes and other technical documentation

6. Sample kit including a PIC16F690 and PIC12F509 device

7. Microchip screwdriver

8. Registration Card

1.5 PICDEM™ MECHATRONICS LAYOUT

®
device
The PICDEM™ Mechatronics is shown in Figure 1-2. A PIC16F917 microcontroller is populated in the 40-pin socket, in which 22 out of the
36 available I/O pins are dedicated connections to several components on the board. The remaining 14 pins are available for the user to connect to the other components on the board, using the provided jumper wires. The dedicated connections connect to the following components:
• Switch 1 – 1 pin: MCLR
• LCD – 17 pins: VLCD1, VLCD2, VLCD3, COM0, COM1, COM2, COM3, SEG0,
SEG1, SEG2, SEG3, SEG6, SEG11, SEG16, SEG21, SEG22, SEG23
• In-Circuit Serial Programming™ Connector – ICSPDAT, ICSPCLK, MCLR
• RS-232 COM port – 2 pins: RX, TX
A 20-pin socket is provided and is compatible with 8/14/20-pin Flash-based microcontrollers. A PIC16F690 microcontroller is provided to use in the 20-pin socket, in which 5 out of the 18 available I/O pins are dedicated connections to several components on the board. The remaining 13 pins are available for the user to connect to the other components on the board using the provided jumper wires. The dedicated connections connect to the following components:
• Switch 1 – 1 pin: MCLR
• In-Circuit Serial Programming (ICSP™) Connector – ICSPDAT, ICSPCLK, MCLR
• RS-232 COM port: RX, TX
Note: Only one microcontroller should be loaded into the board at any given time.
Dedicated pins are indicated by a white box enclosing the pin designation next to each socket. Pay close attention to this designation, as the functionality of the dedicated pins are affected by the circuitry these pins are connected to. It is recommended that you use only the pins not designated as dedicated connections in your design.
The remaining components on the board must be connected to the microcontroller using the provided wire jumpers. The jumpers connect between the headers on either side of the microcontroller and the header pins next to the respective components on the board. The components on the board are labeled in Figure 1-2.
DS51557C-page 10 © 2006 Microchip Technology Inc.
PICDEM™ Mechatronics
)

FIGURE 1-2: PICDEM MECHATRONICS DEMO BOARD HARDWARE

Legend:
6. RS-232 socket and associated
20
DC battery
hardware

7. Temperature sensor

8. Light sensor

9. 2 potentiometers

10. 32.768 kHz crystal

11. 4 tactile switches

12. In-Circuit Debugg er (ICD) co nne ctor13. In-Circuit Serial Programming™
19
(ICSP™) connector
21
Reset switch
associated MOSFET drivers and
logic
14. Over-current protection circuit with
15. 4 half-bridge MOSFET drives wit h
sense
speed of the Brushed DC motor

16. Current sense for output stage

17. Back Electromagnetic Force (EMF
18. Optical Interrupter for detecting the

19. Brushed DC motor

20. Stepper motor

21. Drive screw terminals

22. 9 V
18
15
14
17
13
16
power connections

1. 40-pin socket

2. 20-pin socket

3. On-board voltage regulator and
22
3
pins on the 40-pin socket

4. 8 LEDs

5. 39 segment LCD connected to 14
4
5
1
6
7
© 2006 Microchip Technology Inc. DS51557C-page 11
9
8
10
11
2
12
PICDEMTM Mechatronics Demo Board User’s Guide
The reasons for requiring you to use the provided jumpers to connect components to the microcontroller are three-fold.
1. Y ou will gain knowledge and experience by physically connecting components to the microcontroller.
2. There are more peripherals than pins on the microcontrollers so that you can do more with the board.
3. Should you choose to use the board to experiment on your own, the board allows you the flexibility to do so. You can try experimenting with peripherals not covered in the projects in Chapter 2. “Example Projects”.

1.6 REQUIRED TOOLS

One of the following programming tools is needed in order to complete the projects in the next chapter:
• PICkit™ 2 Microcontroller Programmer (Part# DV164120)
• MPLAB
9V
Figures 1-3 and 1-4 illustrate how to connect each of these tools to the PICDEM Mechatron ics Demo Board.
®
ICD 2 In-Circuit Debugger/Programmer (Part# DV164007 includes a
DC power supply and serial cable)

1.7 PICDEM™ MECHATRONICS SETUP

Please take a moment to review the following steps, prior to using the board. These steps ensure the board is configured correctly before beginning the projects.

1.7.1 Jumper Settings

Remove all 2-pin shunts (jumpers), except for JP8. On JP8, the shunt should be connected in the right most position (indicated by the “+5V” label), which ensures that the drive stage is powered by +5 V

1.7.2 Board Power-Up

Supply power to the board in one of the following ways:
• Connect a 9-12 V
is grounded externally and positive internally.
• Connect a 9-12 V
terminals.
• Connect a 9 V
• Connect a 5 VDC (1.2 amp minimum) supply to TP2 or TP3.
When power is initially connected, the “PWR ON” LED should light up. The “FAULT” LED in the over-current sense circuit will also be on when the board is powered up. Clear the Fault by pressing SW5 (CLR FAULT) switch. The board is now properly configured for the projects.
DC (0.75 amp minimum) supply via J9. The connector’s polarity
DC (0.75 amp minimum) supply to the P21 and P20 screw
DC battery to the battery connector.
DC.
DS51557C-page 12 © 2006 Microchip Technology Inc.
PICDEM™ Mechatronics
FIGURE 1-3: CONNECTING THE MPLAB ICD 2 TO THE PICDEM
MECHATRONICS DEMO BOARD
PICDEM™ Mechatronics
MICROCHIP
MPLAB
R
BUSY
ERROR
POWE
r
i
C
-
n
I
®
ICD 2
r
e
g
g
u
b
e
D
t
i
u
c
FIGURE 1-4: CONNECTING THE PICkit™ 2 TO THE PICDEM
MECHATRONICS DEMO BOARD
PICDEM™ Mechatronics
© 2006 Microchip Technology Inc. DS51557C-page 13
PICDEMTM Mechatronics Demo Board User’s Guide

1.8 GENERAL PICDEM™ MECHATRONICS DEMONSTRATION BOARD INFORMATION

Power Supply Maximum Ratings
Supply voltage: 12 VDC Output current (drive stage): 1.2A (total)

1.8.1 Experimentation

The PICDEM Mechatronics Demo Board was designed for your experimentation. After completing the projects in Chapter 2. “Example Projects”, please experiment freely on your own. Voltage power supplies and motors, other than those provided in the kit, may be used.
The driver portion of the board (the part that supplies power to the motors) has an over-current sense circuit and will trip should the motor draw more than 1.2 amps. The LM7805 regulator also protects the circuit by limiting the current consumed by the board. Logic has also been put in place to ensure that the P and N-Channel MOSFET s connected to each of the output drives can not be turned on simultaneously.
Note: Although reasonable measures have been taken to protect the board from
the occasional mistake, THE BOARD MA Y BE DAMAGED if proper design techniques are not used and special attention to the schematic is not made.

1.8.2 On-Board Status LEDs

There are eight status LEDs on the board specifically provided to assist the user in the developing and debugging of your code. The user can output register values on one of the Ports of the microcontroller and have a binary reading of the value of that register. Connect the LEDs as shown in Figure 1-5. For instance, if it is suspected that the STATUS register is not being set appropriately , move the STATUS value into PORTC. If PORTC is attached as shown in Figure 1-5, the LEDs will show the value of STATUS.
DS51557C-page 14 © 2006 Microchip Technology Inc.
PICDEM™ Mechatronics

FIGURE 1-5: CONNECTING PORTC PINS TO LEDS FOR DEBUGGING

1.8.3 OVER-CURRENT PROTECTION CIRCUIT

The over-current protection circuit included on the board shuts down the drive portion of the circuit if the board drives 1.2 amps continually for 100 ms or longer. Upon powering up the board, the “FAULT” LED will be on. The drive circuit must be reset manually by pressing the CLEAR FAULT button in the lower right hand portion of the board every time the board is initially supplied with power. Otherwise, a Fault is present when the “FAUL T” LED is illuminated and must be manually reset by pressing the same button. If you use your own motor, keep current draw less than 1.2A, as the over-current protection circuit will not allow driving a motor at or above this rating.

1.8.4 MOTOR CONNECTION

The motors provided on the PICDEM Demo Board must be manually connected to the Drive screw terminals. The kit includes a Microchip screwdriver to facilitate in making these connections.
Note: The supplied Brushed DC motor and Bipolar Stepper motor are subject to
change as the motor manufacturers cannot guarantee the same model numbers will be available indefinitely. Please refer to Microchip’s web page (www.microchip.com) for the current data sheets for the motors supplied with this kit, if the motor supplied on your board differs from the motor data sheets found on the CD-ROM.

1.8.5 SERIAL COMMUNICATION

The JP2 jumper is normally not populated with a shunt. With no shunt present, the board is configured for serial communications via the PICmicro Connecting a shunt between the bottom two pins (TX and RX) allows the user to transmit and receive serial communication via one pin (jumper between the microcontroller and the TX/RX pin on JP2).
®
USART (or EUSAR T).
© 2006 Microchip Technology Inc. DS51557C-page 15
PICDEMTM Mechatronics Demo Board User’s Guide

1.8.6 SNAP-OFF SENSORS

The temperature sensor and light sensor can be snapped off to give greater flexibility in using these sensors. For example, the temperature sensor may be snapped off and moved into a more hostile environment, while keeping the board within sight. Once, snapped off, solder wires of the same length between the adjoining holes (i.e., JP3 and JP4 for the temperature sensor) on the PICDEM Mechatronics Demo Board and the sensor board.

1.8.7 BACK EMF SCALING RESISTORS

If choosing to drive your own Brushed DC motor with the PICDEM Mechatronics Demo Board at a voltage higher than +5 V of 0-5 V locations may be populated with resistors to create a simple voltage divider circuit. TP1 is the output of this voltage divider. See the schematic in Appendix A. “Hardware Schematics” for further clarification.
DC. Resistor locations, R55 and R56, are provided for this purpose. These

1.8.8 CURRENT SENSE

The output stage of the board incorporates a simple current sensing circuit, which is assessable at J15 (CURRENT SENSE). At this pin, the voltage is equal to current ± 10%. For instance, if a motor is being driven and it is drawing 0.9 amps, the voltage at the header is 0.9 volts (± 10%).
DC, the Back EMF must be scaled down into a range
DS51557C-page 16 © 2006 Microchip Technology Inc.
Loading...
+ 44 hidden pages