User manual
PICDEM
TM
MECHATRONICS
DEMO BOARD USER’S GUIDE
© 2006 Microchip Technology Inc. DS51557C-page iii
Table of Contents
Preface ........................................................................................................................... 1
Chapter 1. PICDEM™ Mechatronics
1.1 Introduction ..................................................................................................... 7
1.2 Highlights ........................................................................................................ 7
1.3 Quick Start Guide ........................................................................................... 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
®
IDE ................................................................. 20
2.3 Example Projects ......................................................................................... 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 Problems ....................................................................................... 47
3.2.1 VDD Is Below 5V ........................................................................................ 47
3.2.2 No Voltage On Drive Stage ....................................................................... 47