User Manual (DM163029)Table of Contents1.1 Introduction 731.2 Highlights 731.3 Quick Start Guide 831.4 PICDEM™ Mechatronics Development Kit Contents 1031.5 PICDEM™ Mechatronics Layout 1031.6 Required Tools 1231.7 PICDEM™ Mechatronics Setup 1231.8 General PICDEM™ Mechatronics Demonstration Board Information 1432.1 Introduction 1932.2 Loading Projects in MPLAB® IDE 2032.3 Example Projects 2033.1 Introduction 4733.2 Common Problems 473A.1 Introduction 494B.1 Introduction 574Preface51.1 Introduction111.2 Highlights111.3 Quick Start Guide121. Attach the leads of the Brushed DC motor to Drive 1 and Drive 2 using the screwdriver.122. Connect POT1 (on J4) to C1- (on J13) using a wire jumper.123. Connect P1 (on J1) to RD7 (on J10) using a wire jumper.124. Connect N2 (on J1) to RD2 (on J10) using a wire jumper.125. Connect the right and center pins on JP8 using a shunt.12Figure 1-1: Quick Board Setup131.4 PICDEM™ Mechatronics Development Kit Contents141. The PICDEM™ Mechatronics Printed Circuit Board (PCB) with motors142. Pre-programmed PIC16F917 PICmicro® device143. 10 wire jumpers144. 8 2-pin shunts145. CD-ROM including:146. Sample kit including a PIC16F690 and PIC12F509 device147. Microchip screwdriver148. Registration Card141.5 PICDEM™ Mechatronics Layout14Figure 1-2: PICDEM Mechatronics demo Board Hardware151. 40-pin socket152. 20-pin socket153. On-board voltage regulator and power connections154. 8 LEDs155. 39 segment LCD connected to 14 pins on the 40-pin socket156. RS-232 socket and associated hardware157. Temperature sensor158. Light sensor159. 2 potentiometers1510. 32.768kHz crystal1511. 4 tactile switches1512. In-Circuit Debugger (ICD) connector1513. In-Circuit Serial Programming™ (ICSP™) connector1514. Over-current protection circuit with Reset switch1515. 4 half-bridge MOSFET drives with associated MOSFET drivers and logic1516. Current sense for output stage1517. Back Electromagnetic Force (EMF) sense1518. Optical Interrupter for detecting the speed of the Brushed DC motor1519. Brushed DC motor1520. Stepper motor1521. Drive screw terminals1522. 9 Vdc battery151. You will gain knowledge and experience by physically connecting components to the microcontrol...162. There are more peripherals than pins on the microcontrollers so that you can do more with the ...163. Should you choose to use the board to experiment on your own, the board allows you the flexibi...161.6 Required Tools161.7 PICDEM™ Mechatronics Setup161.7.1 Jumper Settings161.7.2 Board Power-Up16Figure 1-3: Connecting the MPLAB ICD 2 to the PICDEM Mechatronics demo Board17Figure 1-4: Connecting the PICkit™ 2 to the PICDEM Mechatronics demo Board171.8 General PICDEM™ Mechatronics Demonstration Board Information181.8.1 Experimentation181.8.2 On-Board Status LEDs18Figure 1-5: Connecting PORTC pins to LEDs for Debugging191.8.3 Over-Current Protection Circuit191.8.4 Motor Connection191.8.5 Serial Communication191.8.6 Snap-Off Sensors201.8.7 Back EMF Scaling Resistors201.8.8 Current Sense201.8.9 Header/Jumper Functions212.1 Introduction232.2 Loading Projects in MPLAB® IDE241. Start MPLAB IDE.242. In the menu bar choose File -> Open Workspace.243. Find the project folder.244. Open the *.mcw file.24Figure 2-1: Project Window242.3 Example Projects242.3.1 Project 1: Hello World (Light a LED)251. Use the PIC16F917 to read a tactile switch input.252. Implement switch debouncing.253. Toggle a LED when a switch is pushed.25Figure 2-2: Project 1: Jumper Diagram25Figure 2-3: Project 1: Schematic252.3.2 Project 2: Dusk Indicator Using the Voltage Comparator271. Use the internal analog comparator module.272. Implement software hysteresis to stabilize the comparator output.27Figure 2-4: Project 2: Jumper Diagram27Figure 2-5: Project 2: Schematic282.3.3 Project 3: Thermometer Using the Analog-to-Digital Converter291. Use the Analog-to-Digital Converter module on the PIC16F917 to read the analog voltage output ...292. Gain knowledge about the LCD module and using the LCD module worksheet.29Figure 2-6: Project 3: Jumper Diagram29Figure 2-7: Project 3: Schematic292.3.4 Project 4: Digital Clock Using Timer1311. Configure the PIC16F917 to use the 32.768kHz crystal to clock Timer1.312. Convert Timer1 into seconds, minutes and hours.31Figure 2-8: Project 4: Jumper Diagram31Figure 2-9: Project 4: Schematic322.3.5 Project 5: Brushed DC Motor Speed Control with Optical Encoder Feedback331. Configure the CCP module to generate a PWM signal.332. Use a PWM signal to vary the speed of a Brushed DC motor.333. Configure Timer1 to use the optical interrupter as its clock source.33Figure 2-10: Project 5: Jumper Diagram34Figure 2-11: Project 5: Schematic352.3.6 Project 6: Brushed DC Speed Control with Back EMF Feedback361. Effectively read Back EMF using the on-board Analog-to-Digital Converter.362. Interpret the Back EMF into a speed for the motor.36Figure 2-12: Project 6: Jumper Diagram37Figure 2-13: Project 6: Schematic382.3.7 Project 7: Stepper Motor Control: Single Stepping, Half Stepping and Microstepping391. Single-step a stepping motor.392. Half-step the motor.393. Micro-step the motor.39Figure 2-14: Project 7: Jumper Diagram40Figure 2-15: Project 7: Schematic412.3.8 Project 8: PC Interface Using the USART431. Use the provided PIC® MCU Communicator GUI to manipulate the I/O on the PIC16F917.432. Understand what an auto-baud routine entails.43Figure 2-16: Project 8: Jumper Diagram43Figure 2-17: Project 8: Schematic44Figure 2-18: PIC® MCU Communicator Interface442.3.9 Project 9: Brushed DC Motor Control Using the ECCP461. Configure the ECCP module for Full-Bridge mode.462. Change motor directions.46Figure 2-19: Project 9: Jumper Diagram47Figure 2-20: Project 9: Schematic483.1 Introduction513.2 Common Problems513.2.1 Vdd Is Below 5V513.2.2 No Voltage On Drive Stage513.2.3 FAULT LED Stays On Or Continues To Trip When SW5 Is Pressed513.2.4 Microcontroller Does Not Run After Programming By The MPLAB ICD 252Figure 3-1: Release From Reset Button523.2.5 Back EMF At J16 Is Floating523.2.6 Board Is Non-Functional When Microcontrollers Are Installed In Both U1 And U2523.2.7 Optical Interrupter Is Not Providing The Expected Feedback523.2.8 Serial Communication Does Not Appear To Be Working52Appendix A. Hardware Schematics53A.1 Introduction53Figure A-1: Schematic Diagram (Page 1 of 7)53Figure A-2: Schematic Diagram (Page 2 of 7)54Figure A-3: Schematic Diagram (Page 3 of 7)55Figure A-4: Schematic Diagram (Page 4 of 7)56Figure A-5: Schematic Diagram (Page 5 of 7)57Figure A-6: Schematic Diagram (Page 6 of 7)58Figure A-7: Schematic Diagram (Page 7 of 7)59Appendix B. LCD Segment Mapping Worksheet61B.1 Introduction61Appendix B: LCD Segment Mapping Worksheet62Worldwide Sales and Service64Size: 2.02 MBPages: 64Language: EnglishOpen manual