Home
PICDEM Mechatronics Demonstration Board User's Guide
Contents
1. 1 1 21 9jeujeyv 1 WO9 4 LWO9 ONO9 1 DS51557D page 58 2007 Microchip Technology Inc LCD Segment Mapping Worksheet NOTES 2007 Microchip Technology Inc DS51557D page 59 MICROCHIP WORLDWIDE SALES AND SERVICE AMERICAS Corporate Office 2355 West Chandler Blvd Chandler AZ 85224 6199 Tel 480 792 7200 Fax 480 792 7277 Technical Support http support microchip com Web Address www microchip com Atlanta Duluth GA Tel 678 957 9614 Fax 678 957 1455 Boston Westborough MA Tel 774 760 0087 Fax 774 760 0088 Chicago Itasca IL Tel 630 285 0071 Fax 630 285 0075 Dallas Addison TX Tel 972 818 7423 Fax 972 818 2924 Detroit Farmington Hills MI Tel 248 538 2250 Fax 248 538 2260 Kokomo Kokomo IN Tel 765 864 8360 Fax 765 864 8387 Los Angeles Mission Viejo CA Tel 949 462 9523 Fax 949 462 9608 Santa Clara Santa Clara CA Tel 408 961 6444 Fax 408 961 6445 Toronto Mississauga Ontario Canada Tel 905 673 0699 Fax 905 673 6509 ASIA PACIFIC Asia Pacific Office Suites 3707 14 37th Floor Tower 6 The Gateway Harbour City Kowloon Hong Kong Tel 852 2401 1200 Fax 852 2401 3431 Australia Sydney Tel 61 2 9868 6733 Fax 61 2 9868 6755 China Beijing Tel 86 10 8528 2100 Fax 86 10 8528 2104
2. L S LHONF jino ea ap mm ON WOW HTON Sdn iaoa anro 3940001 L Ty YMS t 010 OW zx hou E 8co TT ET 2 109 gt AOL MS Oly 88 Josuas 1467 L ae 8 DS51557D page 51 2007 Microchip Technology Inc PICDEM Mechatronics Demo Board User s Guide SCHEMATIC DIAGRAM PAGE 4 OF 7 FIGURE A 4 q lt V 7 JO y 19945 Uos ZH8Z810 t0 4 Wpuog UMDIQ 5002 06 51001 DUJ 80810 0 azis S51u0410u 9 N WACO danny 19 AS t NETT iio oe oz 5005 ET TO Zh 1 XL 8 Goog 294 42 L TT FT os Zar Inra NOZIL zo 541 5630 Hro DA 819 anro Izo 8in aol 20 xy XL 9 X19dS91 z 1904591 4 25 S 212 6
3. M 051 R1 N30 um 050 75 6 gt mm onnect for mm sw2 Fui Bridge 583 5 e ro2 ccr2 n0 0 Ne Mes 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 FAULT 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 she
4. ocu abpug 204 eee e5pug 9 20 j2euuo5 mm 1 90 10 5 kizima 00S 6Nv L04 1 45 0 988 223 NIZI SNV LOU NIZI YNV 094 4noto zNv zv 7 3 1392 558 Eo LMS SEI VISANI WB 2459 25 LA DS51557D page 33 2007 Microchip Technology Inc PICDEM Mechatronics Demo Board User s Guide FIGURE 2 13 PROJECT 6 SCHEMATIC VDD PIC16F917 LCD1 11 32 COMx Common pins VDD R10 2 SEGx Segment pins 10ko 27 MAN e ANO __ C26 VIM 332 DP 1000 pF VDD ale U11 B R32 30 Back EMFL e T ANA RDS gt c36 T 1000 pF ere Back EMF U10 A 2 2 12 31 p gt n Vss i T 10kQ Simplified circuit shows equivalent functionality Instructions POT1 adjusts the speed of the motor Set POT1 at 100 to run the motor at full speed The speed indicated on the LCD should be similar to the speed shown in Project 5 Next run the
5. ana vr e e e EN 2255 1 lt 22 35 2 lt 9 002 11019 7 27 0 e owv evs Moment in eir 19 29 29 19 650 veo 2104 DS51557D page 43 2007 Microchip Technology Inc yjeuonounj eu MOUS jeu PROJECT 9 SCHEMATIC FIGURE 2 20 02 SSA 0105 A 9 y ard dd T 979 avv og TO e 1 Old 2 OM OL AS g Vid 06949L2Id UN OL avez e 9 g ald OX OL ZR f x L 4 a gt p e JOJON nr 4 AG PICDEM Mechatronics Demo Board User s Guide 2007 Microchip Technology Inc DS51557D page 44 Example Projects Instructions Use to adjust the speed of the motor SW2 toggles between the following four modes of operation Motor Off Forward Motor Off Reverse Discussion The ECCP module is ideal for driving a full bridge circuit Dead band Delay Control and Automatic Shutdown are some of the other features of the ECCP module when configured in PWM mode Dead band Delay Control allows you to control when the
6. lt lt lt DS51557D page 22 2007 Microchip Technology Inc Example Projects 2 3 2 Project 2 Dusk Indicator Using the Voltage Comparator If you have yard lights or a porch light at home that automatically turns on at dusk then you are familiar with the application we will create in this project The comparator on the PIC16F917 will be used to compare the voltage level from the potentiometer to the voltage level out from the light sensor When the intensity of the light to the sensor is reduced below the trip point set by the potentiometer the LED will turn on Objectives 1 Use the internal analog comparator module 2 Implement software hysteresis to stabilize the comparator output Applicable Technical Documents PIC MCU Comparator Tips n Tricks 0541215 Jumper Configuration C1 J13 to LIGHT J4 C1 J13 to 94 RD7 J10 to DO J14 FIGURE 2 4 PROJECT 2 JUMPER DIAGRAM 01 02 03 04 05 06 07 maa o Ne teen 190900000 5 9 Ut RD7 06 RDS RD4 gt Rc5 ccP1 0 0 gt 0 00 RD2 ccP2 m 2007 Microchip Technology Inc DS51557D page 23 PICDEM Mechatronics Demo Board User s Guide FIGURE 2 5 PROJECT 2 SCHEMATIC VDD PIC16F917 Lig
7. MIOW LAS GLI VISANI 248975 LA 55 2104 um Zia L10d 920 Nm N 2007 Microchip Technology Inc DS51557D page 36 Ayjeuonounj juejeanbe eu MOUS jeu padus Example Projects PROJECT 7 SCHEMATIC FIGURE 2 15 2 2492 O1GS ON 65 4 gt e 77 as SSA Tezi RAA __ Jeddeis ON 65 4 4 52904 9 3d 0001 T 929 O 2 Nh Old A 2 409 ON GS x O 9 1 9 LVN oto UA lt 6 Dh 22 ol 2 8 Fe 62 944 EN L 4 eet 10 DUIPUIMA Jeddeis d 4 T 4 2034 11649194 DS51557D page 37 2007 Microchip Technology Inc PICDEM Mechatronics Demo Board User s Guide Instructions Adjusting POT 1 varies the speed of the motor Toggle between single stepping half stepping and microstepping modes by pressing SW2 At low speeds the motor should noticeably step in single stepping and half stepping modes The movement will
8. INTRODUCTION 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 2007 Microchip Technology Inc DS51557D page 1 PICDEM 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 DS51557D page 2 2007 Microchip Technology Inc
9. N e Le 9 8 9 5 8 5 9 Sls Z2 3 8 2 a gje 55905 Ez e 2 n o T 5 o 8 amp 3 15 2151 ANE 8 8 Sle S m 5 2 18 ER a x A 2 FIDUCIAL_ PP x2 x FIDUCIAL PP r3 C Q 1uF FIDUCIAL_ PP C a a gt EX X 585 5758 5 5 2 O Oj u ju juu x gt lt ats ojo gs amp 5 5 5 xis PEN 5 S R RES is ol fel fol fol 8 5 S 5 5 ENSE a BW 1 OQ 6 O o aa 51 16 v 1639 10d E 969 v893910ld Ceooceo 5 4 4 4 4 4 54554344 4 5 35464 af 474474 s fel fol B RSS ol fel fol fel 2 5 S 2 5 5 TON ST ER RE a a a TT et ES eae ae eR a lac TINIM
10. gt 8 81812 221418 81818 alala ojos B O19 N SAN L 2007 Microchip Technology Inc DS51557D page 49 PICDEM Mechatronics Demo Board User s Guide SCHEMATIC DIAGRAM PAGE 2 OF 7 FIGURE A 2 a 5 7 2 jo 39945 Vos ZU8Z810 t0 9UIDUO d uojsey Aq UMDIQ 82 6 5100 qpuog uoysay Buz S 80810 lt 0 d eni 034 Gay 038 lt 034 50 0 50 6 6022 SULZ lt 9040 lt 5010 854 944 24 ve Seu 923 M o ls 5 5 vir dQ Z NWIA 0935 25 15 91935 64 794 94 94 64935 22935 LOO 2 22 92 82 12935 02 32 32 2 9935 XE d0 9 9 8 11935 anyo 1284 ac ac ac ve 935 448 2 8 2935 200 0v 1iv8 04 1935 woo WOO anyo t 015 i LWOO 1WO2 1021 8 2007 Microchip Technology Inc DS51557D page 50 Hardware Schematics
11. nr NO 8 9521 Jnezz 9 Es SION 452 as XMS 50 2 ave 21 6 er WT 199451 Toso zi gt 94591 PTE p 225 se i i 1 t gt T 90810 in aa en L DOA 2 V 2007 Microchip Technology Inc DS51557D page 52 Hardware Schematics SCHEMATIC DIAGRAM PAGE 5 OF 7 FIGURE 5 9 1 10 19945 455 2482810 0 oUDUS I4 ypuog uojseu Aq UMDIQ 002 0 lt 9100 puco ET T 80810 0 e 2215 nm AOL 2301 35535 2105 69 21 605 451 5 zn 340 Svsiva F C s nit 3 e 22111 a sn ld AI 1 1 sani v 208 0999 01 LLO e ai gn 2 OLN 87 YN Hz WMd
12. CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions DOCUMENTATION CONVENTIONS Preface Description Represents Examples Code Courier font Plain characters Sample code Filenames and paths define START c autoexec bat Angle brackets lt gt Variables lt label gt lt exp gt Square brackets Optional arguments MPASMWIN main asm Curly brackets and pipe character Choice of mutually exclusive argu ments An OR selection errorlevel 0 1 Lowercase charactersin Type of data filename quotes Ellipses Used to imply but not show addi list tional text that is not relevant to the list option example list option Oxnnn A hexadecimal number where n is a OxFFFF 0x007A hexadecimal digit Italic characters A variable argument it can be eithera char isascii char type of data in lowercase characters ch or a specific example in uppercase characters Interface Arial font Underlined italic text A menu selection from the menu bar File gt Save with right arrow Bold characters A window or dialog button to click OK Cancel Characters in angle A key on the keyboard Tab lt Ctrl C gt brackets lt gt Documents Arial font Italic characters Referenced books MPLAB IDE User s Guide 2007 Microchip Technology Inc DS51557D page 3 P
13. China Chengdu Tel 86 28 8665 5511 Fax 86 28 8665 7889 China Fuzhou Tel 86 591 8750 3506 Fax 86 591 8750 3521 China Hong Kong SAR Tel 852 2401 1200 Fax 852 2401 3431 China Qingdao Tel 86 532 8502 7355 Fax 86 532 8502 7205 China Shanghai Tel 86 21 5407 5533 Fax 86 21 5407 5066 China Shenyang Tel 86 24 2334 2829 Fax 86 24 2334 2393 China Shenzhen Tel 86 755 8203 2660 Fax 86 755 8203 1760 China Shunde Tel 86 757 2839 5507 Fax 86 757 2839 5571 China Wuhan Tel 86 27 5980 5300 Fax 86 27 5980 5118 China Xian Tel 86 29 8833 7252 Fax 86 29 8833 7256 ASIA PACIFIC India Bangalore Tel 91 80 4182 8400 Fax 91 80 4182 8422 India New Delhi Tel 91 11 4160 8631 Fax 91 11 4160 8632 India Pune Tel 91 20 2566 1512 Fax 91 20 2566 1513 Japan Yokohama Tel 81 45 471 6166 Fax 81 45 471 6122 Korea Daegu Tel 82 53 744 4301 Fax 82 53 744 4302 Korea Seoul Tel 82 2 554 7200 Fax 82 2 558 5932 or 82 2 558 5934 Malaysia Penang Tel 60 4 646 8870 Fax 60 4 646 5086 Philippines Manila Tel 63 2 634 9065 Fax 63 2 634 9069 Singapore Tel 65 6334 8870 Fax 65 6334 8850 Taiwan Hsin Chu Tel 886 3 572 9526 Fax 886 3 572 6459 Taiwan Kaohsiung Tel 886 7 536 4818 Fax 886 7 536 4803 Taiwan Taipei Tel 886 2 2500 6610 Fax 886 2 2508 0102 Thailand Bangkok Tel 66 2 694 1351 Fax 66 2 694 1350 EUROPE Austria Wels Te
14. NIZ9 Nv 00 v14 1499 504 anya NN si 1 CFE n 55 na 9 NILo 1Nv7 La Qinono vs WOLLdO ar ss 9v zn CNN NM ocu Zd99 208 SBPLE INA 9193S 0 W02 0QH EE ke jum 5 ZMS f 11935770N 95357555 EX 14997655 Cao ZO re E 1 928 RAD W 123 m m cr zn KULIA LOOTA 094 EN cn vau 622 es Sas ISOLL ZVH LMS SSA Lay SEO VISANDO S 5 gt 1 19 mE 90 220357139 a DS 0935708 129357039 HE m 1935718 959 2 M 4ON 20 29357089 0 935 6 2104 107585 INV 1V8 12445217984 ZA 1705017284 MIOW C3N QNS 20 21 6 2 onum 5 35 4031 2 EN En QN9 241 YOLON 3399315 DS51557D page 9 2007 Microchip Technology Inc PICDEM 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 Pre programmed PIC16F917 PIC device 10 wire jump
15. RC VLCD1 RC1 VLCD2 RC2 VLCD3 RC3 SEG6 RD COM3 RD1 J10 Rs7 csPorT lt 5 4 RB3 SEC3 RB2 SEc2 1 1 c VOD vss R07 Ros e 0 200 9 rc5ccr1 02 2 9 0 cc NB erdum um OF ME erc er Nm NN IN 2007 Microchip Technology Inc DS51557D page 39 PICDEM Mechatronics Demo Board User s Guide FIGURE 2 17 PROJECT 8 SCHEMATIC VDD U18 VDE C21 0 1 uF C17 0 1 uF 16 16 917 3 11 32 eu 0 1uF 2 YA 4 VoD B 1 5 20104 uF E R36 l2 14 11 ie prd 8 _ 193 10 300 0 2700 09 1 8o 4 13 12 9107 8 9 WP C17 0 1 uF v GNDItS Hai MAX3232CUE L 9 RX 2 3000 121311 Instructions Locate the MCU Communicator GUI in the PIC MCU Communicator folder in Project 8 on the CD ROM Choose the Comm Port and baud rate Then click Open Comm Enter TRISD in the top Label text field Enter 088 into the top Addr text field Check the top Hex box Enter 7F into the Data field In the box labeled Bit C
16. 2007 Microchip Technology Inc MICROCHIP PICDEM Mechatronics Demonstration Board User s Guide DS51557D 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 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 Digital Millennium Copyright Act If such acts allow unauthorized access to your software or other copyrighted work you may have a r
17. J14 LED connect pins 115 Current sense feedback from the drive stage 916 Back EMF feedback signal pins JP2 Single pin serial communication jumper see Section 1 8 5 Serial Communication for details JP8 Drive circuit voltage selection See diagram on board Onthese jumpers the pins are connected in pairs horizontally This allows one pin to be used for jumping to from the microcontroller using a wire jumper and the other pin for probing the circuit with test equipment 2007 Microchip Technology Inc DS51557D page 17 PICDEM Mechatronics Demo Board User s Guide NOTES DS51557D page 18 2007 Microchip Technology Inc PICDEM MECHATRONICS MICROCHIP DEMO BOARD USER S GUIDE Chapter 2 Example Projects 2 1 INTRODUCTION The following projects cover basic mechatronic principles such as reading a sensor interfacing to a LCD and driving a motor These projects also provide examples of how to use the various PIC microcontroller peripherals The projects are presented sequentially so that you will build knowledge as you progress from one project to the next Those who are new to programming PIC microcontrollers should pay special attention to the comments in the source code for each ofthe projects Though these projects are not intended to teach you the Microchip Assembly language you will be able to get a good grasp of Microchip s Assembly language by reading the source code Micr
18. Objectives 1 Configure the CCP module to generate a PWM signal 2 Use a PWM signal to vary the speed of a Brushed DC motor 3 Configure Timer1 to use the optical interrupter as its clock source Applicable Technical Documents Brushed DC Motor Fundamentals Application Note AN905 DS00905 Low Cost Bidirectional Brushed DC Motor Control Using the PIC16F684 Application Note AN893 DS00893 Jumper Configuration RD7 J10 to P1 J1 CCP2 J10 to N2 J1 ANO J13 to POT1 J4 RC5 J10 to Optical Interrupter J7 Attach the motor leads to DRIVE1 P9 and DRIVE2 P10 J2 and J3 should be unpopulated no shunts present Connect the right and center pins of JP8 using a shunt 2007 Microchip Technology Inc DS51557D page 29 PICDEM Mechatronics Demo Board User s Guide JUMPER DIAGRAM PROJECT 5 FIGURE 2 10 EB zz NN zia Wu m e Od peusnig Old 6d INYA 2 3AI8Q INYA 75 SMS 6q 920 ZEN mme 98 eps m cig 10 cal kizima 5 6 soll 1 9591 10S70LNY 84 nie 2 m mE
19. SCHEMATIC DIAGRAM PAGE 3 OF 7 FIGURE 3 9 g 7 jo 19845 5 2482810 00 5410 911 ypuog uoysey Aq UMDIG 802 0 5100 3puo9 1 5 E poc VLVOLOL 80810 lt 0 925 lo CI 820 anaj EE AK a IL zin OM ST 769 peiojndoq 4osueg ajnjojadwaj 2 JON 250 _ 1950 si MS anro yon 2950 2 5 4 kal L 5 z p gpm 8 29 __________ S er 6 050 amp 5 7 2103 _ _ 9 gt 30N 7 3922 3922 59 Izuygg zc 759 iso LA ON WOW ON WOW 390001 x B EMS 010 ZMS O 2104 18 TE GY Rd 213 2104 f i 98 vu MWOSN3S 1H9n
20. The PIC MCU Communicator GUI is included in this project as an example GUI However it is also a great tool for debugging Experiment with using the GUI to setup other peripherals on the microcontroller EA 1 lt _______ ___ 2 2007 Microchip Technology Inc DS51557D page 41 PICDEM Mechatronics Demo Board User s Guide 2 3 9 Project 9 Brushed DC Motor Control Using the ECCP This project is very similar to Project 5 only in this project we are using the Enhanced Capture Compare PWM ECCP module in the PIC16F690 see note In PWM mode the ECCP module has four outputs for directly driving an H bridge circuit This makes implementing bidirectional speed control of a Brushed DC motor a simple task Note Tochange microcontrollers disconnect power from the board Remove the PIC16F917 microcontroller from U1 and install the PIC16F690 in U2 Reconnect power to the board Objectives 1 Configure the ECCP module for Full Bridge mode 2 Change motor directions Applicable Technical Documents Low Cost Bidirectional Brushed DC Motor Control Using the PIC16F684 Application Note AN893 DS00893 Jumper Configuration P1A J6 to P1 J1 P1B J6 to N1 J1 P1C J6 to P2 J1 P1D J5 to N2 J1 AN2 J5 to POT1 J4 RA5 J6 to SW2 J4 Make sure there are no shunts two pin jumpers on J2 Attach the Brushed DC motor leads to DRIVE1 P9 and DRIVE2 P10 Connect the r
21. 20 2 9 Example Projects 20 2 3 1 Project 1 Hello World Light a 0 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 sse 27 2 3 5 Project 5 Brushed DC Motor Speed Control with Optical Encoder Feedback sse 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 e Elm 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 2007 Microchip Technology Inc DS51557D page iii PICDEM Mechatronics Demo Board User s Guide Chapter 3 Troubleshooting 1 47 3 2 Common Problems 47 3 21 VDD Is BeloW BV a de 47 3 2 2 No Voltage On Drive Stage 47 3 2 3 FAULT LED Stays On Or Continues To Trip When 5 5 Is Pressed 47 3 2 4 Microcontroller Does Not Run After Programming By The MPLAB ep 48 3 2 5 Back EMF At J16 Is 48 3 2 6 Board 15 Non Func
22. NIZ9 SNV 08 8 3 1 02 223 lt 5 2 sir NIZO YNV 004 Yi4 1409 504 1NO1 ZNv zvu CFE ana NILO ONv OV3 YALANYYLNI 1VOLLAO 47 ss pe n 2211 UNO I ec NR ling 615357505 509 005 Be 035 708 9938 94 Hef 1422 6028 raoweos EN sn vay 050 17974 629 ISOLL LVY SOW IMS gay SSA so 22 n 90 TVLSAHO SSA 2035 238 ZHA 89222 22935 133 Es an REZ N M Ge T 1935 188 co3s cau 2104 Er _1no9 sax UNW La ONV OVH za ta ea W3Q9ld 2007 Microchip Technology Inc DS51557D page 30 Example Projects FIGURE 2 11 PROJECT 5 SCHEMATIC VDD PIC16F917 LCD1 11 32 COMx Common pins VDD 1 R10 2 Segment pins 10 27 1kQ 1 C26 VIM 332 DP L 1000 pF VDD VDD D7777777 011 R20 Ris RD7 90 4700 20 R22 24 RC5 0 Q6 4700 10 012 We Motor U10 A 21 i CCP2 12 3
23. pe sir 3SN3S LNSYYND d DS51557D page 55 2007 Microchip Technology Inc PICDEM Mechatronics Demo Board User s Guide NOTES DS51557D page 56 2007 Microchip Technology Inc PICDEM MECHATRONICS MICROCHIP DEMO BOARD USER S GUIDE Appendix B LCD Segment Mapping Worksheet B 1 INTRODUCTION This appendix contains the LCD Segment Mapping Worksheet 2007 Microchip Technology Inc DS51557D page 57 LCD Segment Mapping Worksheet LCD SEGMENT MAPPING WORKSHEET APPENDIX B ZNV OL 1 9L 1 ev1vaao1 1 1 22945 9NV 6 9 Al 9 8v1Vad91 9 1 VL 9 Tv1vad91 229146 SNV 03H 8 dac 22 S 8 1 92 S S 2945 06 svivddol Sv1vad91 Y Tv1vad91 02945 6c evivado1 Sv1vad91 6 938 82 c 8ev1vaao1 Sv1Vad91 81535 vau 22 L LLWLvado1 evivaao1 svivado1 vivado1 41935 9 W 0 0 8v1vad91 25 0 Sv1vad91 LS 0 lt 9 935 dJ3HA ENV 4 6 1 0LVIVQGO1 1 4 1 0 21 2 1 1 1 21 91935
24. the temperature sensor reading automatically over varying supply voltages and process variations in the parts themselves This saves the manufacturer costly calibration time at the factory that is typically required by traditional temperature sensing technologies LCD functions were introduced in this project for displaying data on the provided LCD Take a look at the LCD worksheet in Appendix B LCD Segment Mapping Worksheet This is the same worksheet located in the PIC16F91X Data Sheet DS41250 only it has been filled in using the information from the PICDEM Mechatronics Schematic see Appendix A Hardware Schematics for the schematic In the LCD source code provided in this project you can see that the information in this worksheet has been converted into ine statements for each of the segments UU UU E o DS51557D page 26 2007 Microchip Technology Inc Example Projects 2 3 4 Project 4 Digital Clock Using Most appliances that have a LCD show a clock readout when the appliance is not in use In this project Timer1 is used to create a real time clock readout on the LCD Objectives 1 Configure the PIC16F917 to use the 32 768 kHz crystal to clock Timer1 2 Convert Timer1 into seconds minutes and hours Applicable Technical Documents Clock Design Using Low Power Cost Techniques A
25. time hours and minutes and displaying the seconds by pressing Switch 4 Discussion The 32 768 kHz crystal is used to take the guess work out of creating a clock display You may recognize this frequency as being 21 kHz This makes it very easy to convert clock pulses to seconds in the binary world of a microcontroller Every time bit 15 in Timer1 changes one second has elapsed A crystal is used because an RC oscillator will have an unacceptable degree of error after several days DS51557D page 28 2007 Microchip Technology Inc Example Projects 2 3 5 Project 5 Brushed DC Motor Speed Control with Optical Encoder Feedback Motor control is required in many mechatronic applications ranging from power windows to washing machine cycle control This project will demonstrate speed control of a Brushed DC motor Brushed DC motor control is simple as the commutation or sequencing of power to the various windings is automatically performed by the motor s brushes In this project the Capture Compare PWM CCP module will be used in PWM mode to generate a Brushed DC motor drive Timer1 will measure speed feedback from the optical interrupter on the board The optical interrupter circuit generates a high signal when light passes through the slots in the encoder disk By measuring the time between pulses the speed of the motor can be determined A real life application example includes precision speed control of a fan or hard disk drive
26. wvco ee 10 3 lt RA4 lrez sec2 R44 R41 RAS AN4 10 jrei secc1 R40 NM NN REQ SEG211 jRee seco RE1 SEC22 SB vo RE2 SEC23 vs VDD R07 vss 200 7 1051 05 RA6 T1050 e vee RC1 VLCD2 gt RC2 VLCD3 5 1 RC3 SEC6 gt S RD1 02 2 FIGURE 2 3 PROJECT 1 SCHEMATIC VDD VDD T PIC16F917 11 32 R4 VDD 10 30 R36 SW2 R5 RD7 AAA 2709 2 m 12 31 i X Vss 2007 Microchip Technology Inc DS51557D page 21 PICDEM Mechatronics Demo Board User s Guide Instructions Pressing SW2 toggles LED 00 on and off Discussion Switch debouncing is done to ensure that mechanical contact chatter in the switch is not mistaken for more than one button push Debouncing also ensures that for every one press of the button only one function is executed In this project that function is toggling a LED Note See Section 2 2 Loading Projects in MPLAB IDE for the location of the source files for this project and all subsequent projects EEE A
27. 08 is on the drive stage is disabled Press the CLR FAULT button SW5 to enable the drive stage 3 2 3 FAULT LED Stays On Or Continues To Trip When SW5 Is Pressed Verify that the motor is not drawing over 1 2 amps Check the voltage at CURRENT SENSE J15 before the FAULT LED turns on again Voltage is equal to the current at J15 therefore if the voltage is 1 2V or greater the drive is drawing too much current or possibly shorted Verify the motor is being driven properly The N channel and P channel MOSFETSs on any given Drive DRIVE 1 DRIVE 2 etc should not be turned on simultaneously See note J2 connects the MOSFET control lines for DRIVE 1 and DRIVE 2 and J3 connects the control lines for DRIVE 3 and DRIVE 4 If shunts are present on J2 and J3 verify that they are connected intentionally and not from a previous design Note Hardware is in place to ensure the N channel and P channel MOSFETs a given Drive are not turned on at the same time However if you are Switching the N channel MOSFET rapidly it is possible for both MOSFETS to be on at the same time 2007 Microchip Technology Inc DS51557D page 47 PICDEM Mechatronics Demo Board User s Guide 3 2 4 Microcontroller Does Not Run After Programming By The MPLAB ICD 2 When using the MPLAB ICD 2 as a programmer the microcontroller will not run unless you disconnect the MPLAB ICD 2 or release the MPLAB ICD 2 from Reset Figure 3 1 shows the Rele
28. 1 ss 1 gt 10 4 Simplified circuit shows equivalent functionality Instructions Use 1 to adjust the speed of the motor Turn the potentiometer counter clockwise to reduce speed turn it clockwise to increase motor speed Multiply the LCD display by 1000 to obtain speed in RPM Discussion With the CCP module operating with 8 bits of resolution the module can output a PWM signal at a frequency of 31 2 kHz This is sufficiently high frequency that motor whine is outside of the audible frequency for humans This is especially important in applica tions where the motor may turn at slow speeds Using an optical sensor to gather feedback from a motor is an integral part of many mechatronic systems Some systems require a constant speed over varying loads An optical encoder is similar to the optical interrupter circuit used in this project The difference is that an optical encoder uses more than one optical sensor as many as four to deduce speed and shaft position Note The optical interrupter circuit is susceptible to interference from outside infrared light sources i e incandescent lights sunlight etc It may be necessary to cover the optical sensor to obtain an accurate reading 2007 Microchip Technology Inc DS51557D page 31 PICDEM Mechatronics Demo Board User s Guide 2 3 6 Project 6 Brushed DC Speed Control with Back EMF Feedback Project 5 uses an optical encoder to
29. 4 2 05 699 01 5 LNS el T T a sn OlOS 49vv21 Q800HV NS LL me a 0 a 1 azn es e oH er gt AOL 2301 164 8vd 2 05 699 01 LNS m 9 C 5 5 1 asi 9 9n OlOS 49vv2L 5 1 on m Loe YN WMd 2007 Microchip Technology Inc DS51557D page 54 Hardware Schematics SCHEMATIC DIAGRAM PAGE 7 OF 7 FIGURE 7 2 8 1 JO PAS 98 2482810 0 4 ypuog uojsey Aq UMOIG 082 06 9190 diH2082IW NM T T 86810 90 2215 T 5296 31 SOIUOIFDUSSWN WAI pope 4 214 x 504 550 LIU BW TVOILdO s c HOZ 50 OT NA 924 L n Gan nva vaa 4 19 80 0 58 SMS 506 A eod 60 80 LJnre Lanre Zed YNDAZOOZOATHLNS L 5001 9 SM LYNI gen 9 via B SM8v 9 n k YNDAZOIZINYLN NS I ZZ 9d ON zai Nero E sio nva 2 TE ST T X1 GOA an g 6n s AN v 6n yor z 35 35 1
30. 5 984 6 4c 9 0LVIVQGO1 9 V1IVQd21 9 vv1Vad91 9 LWLvddo1 vLOAS ivddodl Lvddsol 18H 07 80 S 0LVIVQGO1 S V1IVQd21 S PVIVQdo1 S I VIVQdO1 1935 ONV Y 0lV1Vad91 2v1vVada91 vvivddol 2 935 OGS 9LL v94 8 91 dae 0LVIVQG21 9 96 yvivddol ge 938 LdO9 IMOLL c 0OLVIVQGO1 z lv1vada91 0 998 19S H9S M9 XL 994 62 21 L olv1vVaa97 L 2vivado1 pvivado1 L bWivado1 6938 194 92 81 0 0LVIVQGO1 0 0 0 LV1VQqd91 8945 LNV Lwa 5 5 L 6v1vaao1 1 9v1vaao1 L v1vad91 L 0v1vaga91 21938 9 1 gc 9 9 1 42 9 evIvaqo1 9 ovLvddo1 9945 55 1 2 LIL S S 9 1 G v1Vad91 S 0 1 21 9938 IHO0L 1NO1L9 9 9 6V1Vad91 9v1vVad91 0v1vada91 7935 9 vc ae 6v1Vad91 9 1 de 2945 98 65 z 6v1vaao1 9 4 9v1vaao1 HH 1 OVLVdd91 2935 Lay YEZ L 6vV1Vaa97 L 9v1vVaa97 evivado1 L 0v1vVaa97 935 INI ogy 66 12 U 0 svivaddi 0 9 1 0 evivddol V 0 0 1 21 0945 ssoippy 55 ssoippy 55 suoyounJ 0 82 21
31. ICDEM 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 instructions on how to use the PICkit 2 Microcontroller Programmer hardware and software MPLAB ICD 2 In Circuit Debugger User s Guide DS51331 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 PIC 16F631 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 CMOS Microcontroller device specifications MPLAB IDE S
32. ISA NB SANG E E SM td mm a een poy AA ce INYO eid Ll on Bia 212 6d eeu e 622 Seo sn 3SN3S 1 88 cia via 295 98 s o Gid 9Nv 794 NIZ9 SNV 194 NIZO NW 008 LNOLO ZNV Zve NTO LNW vel ss Q 2 zo rosso yauuog mem memi 20 40 000000000 ovs Bry pe an ie eco Ima pua ane j98uu09 Lv Mc EB ET rt ve 10357703 10 N Q 2237s 10 Ea 572 vay 1 sas L 1 SSA Be 2935 084 1935 188 2935 5285 o3s cau ON09 r8 e noosa 98 10 Evos ZA cr ee xs oas 6nv zou snv gou 4 1 022 728 7 3 1990 508 noce Npno sva Bou en Q no eas 9935 2934 22 ejza w ios 0 cove 0501 17974 co ou szo3s z3u 22235 1 34 2935 03 vo ve cv m
33. Lx iz INYA AOL i ec 61 grex esperes 1 Lane Late Wed si 629 622 idiot m ES 1 6 gt YON EN 1 8 7 sz AN3 7 44000 O4z 35435 Ley Sora 5 doi 9105 69770 m 918 605 45 d200H ZNS Alddns AS Zeus 3401 5 51 8 Hm 5 x 99 T 60Y ed von v 9n zb pu 6d P 2105 49 21 5 ven Sh 1 v in AIG zou 99 aaa aan 2 DS51557D page 53 2007 Microchip Technology Inc PICDEM Mechatronics Demo Board User s Guide SCHEMATIC DIAGRAM PAGE 6 OF 7 FIGURE A 6 a 5 8 1 10 9 PNS WS 2582810 50 501005113 uojsay Ad UMDIG 6602 06 9100 3pucg dIHDOEDIYY 2 80810 lt 0 2215 Y INYA 21409 INXA 3SN3S 4401 76498 v 3991 19 6051351 39VL10A INYA 35 35 m 605351 xL SvGlv8 o 919 61d He o PSTN don l 605 31 Sio 39VL10A 3AMQ Inva AOL 4301 597
34. MOSFETs in the full bridge circuit are turned on and off in relation to one another This is done in order to automatically account for the MOSFET turn on and turn off times Automatic Shutdown allows you to define the shutdown state of the ECCP when a shutdown event occurs V A s c d 2007 Microchip Technology Inc DS51557D page 45 PICDEM Mechatronics Demo Board User s Guide NOTES DS51557D page 46 2007 Microchip Technology Inc PICDEM MECHATRONICS MICROCHIP DEMO BOARD USER S GUIDE Chapter 3 Troubleshooting 3 1 INTRODUCTION This chapter describes common problems associated with using the PICDEM Mechatronics and steps on how to resolve them 3 2 COMMON PROBLEMS 3 2 1 VDD Is Below 5V The board must be powered by one of the following 9 12 source at the screw terminals P20 and P21 A 9 12 VDC source at J9 9 battery 5 power source at TP2 and Supplying less than 9 at J9 the screw terminals will not allow the regulator 03 to function properly causing VDD to be below 5 3 2 2 No Voltage On Drive Stage There must be a two pin shunt present on connecting the middle pin to 5 VDC or 9 12 This is the supply reference for the drive stage If the FAULT LED
35. UIRED 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 ICD 2 In Circuit Debugger Programmer Partt DV164007 includes a 9 Vpc power supply and serial cable Figures 1 3 and 1 4 illustrate how to connect each of these tools to the PICDEM Mechatronics Demo Board 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 Vpc 1 7 2 Board Power Up Supply power to the board in one of the following ways Connect a 9 12 Vpc 0 75 amp minimum supply via J9 The connector s polarity is grounded externally and positive internally Connect a 9 12 Vpc 0 75 amp minimum supply to the P21 and P20 screw terminals Connect a 9 Vpc battery to the battery connector Connect a 5 Vpc 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 pr
36. ase From Reset button FIGURE 3 1 RELEASE FROM RESET BUTTON uS f Le 3 2 5 Back EMF At J16 Is Floating Check that a Fault has not occurred by checking that the FAULT LED is off Verify the Brushed DC motor is connected between DRIVE 1 and DRIVE 2 In order to measure Back DRIVE 1 must float and DRIVE 2 must be grounded i e the N channel MOSFET for Drive 2 is the only MOSFET turned on 3 2 6 Board Is Non Functional When Microcontrollers Are Installed In Both U1 And U2 Only one microcontroller should be installed on the board at any given time 3 2 7 Optical Interrupter Is Not Providing The Expected Feedback The optical interrupter circuit is susceptible to interference from outside infrared light Sources i e incandescent lights sunlight etc It may be necessary to block this Source or turn off the light source when using the optical interrupter 3 2 8 Serial Communication Does Not Appear To Be Working If using the USART on the PIC16F690 or PIC16F917 note that the TX and RX pins are already connected Make sure there is no shunt present on JP2 DS51557D page 48 2007 Microchip Technology Inc PICDEM MECHATRONICS MICROCHIP DEMO BOARD USER S GUIDE Appendix A Hardware Schematics INTRODUCTION This appendix contains the PICDEM Mechatronics Board Schematic Diagram FIGURE A 1 SCHEMATIC DIAGRAM PAGE 1 OF 7 N EN 5 8
37. 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 M Connector ICSPDAT ICSPCLK MCLR 5 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 DS51557D page 10 2007 Microchip Technology Inc PICDEM Mechatronics PICDEM MECHATRONICS DEMO BOARD HARDWARE FIGURE 1 2 6 ZZ S CUIWU9 BAU Jojow JeddaiS 702 peysnig 6 JOJOW peysnig y jo peeds Jajdnwaju 79 asuas 4IN3 22104 xoeg 77 95195 j
38. be quite jerky in both modes though to a lesser extent in the half stepping mode In microstepping mode the jerky motion should be virtually eliminated Discussion Stepper motors are used in many positioning applications For example ink jet printers and smaller CNC machines employ stepper motors Stepper motors are ideal for these applications because as long as they are not overloaded the distance a stepper motor moves is always known Stepper motors are also brushless which makes them more reliable than brushed motors Finally stepper motors are very responsive to starting and stopping and will produce the highest torque at low speeds Half stepping is used to give a stepping motor two times its rated step resolution However there is a word of caution A stepper motor is typically not rated to have more than one winding energized at a time As a result the motor will heat up if both windings are energized at the rated voltage of the motor To offset this when both windings are energized simultaneously the average current to each winding should be 0 707 times the rated current Microstepping offers several advantages over single stepping and half stepping First torque is fairly constant between steps This results in smoother rotation and decreased shaft oscillation Secondly a higher step resolution is achieved This means a low cost motor can be used in an application that would normally require a more expensive higher resolutio
39. ers 8 2 pin shunts 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 Microchip screwdriver 8 Registration Card cr ge om 1 5 MECHATRONICS LAYOUT 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 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 COMO COM1 2 COM3 5 0 SEG1 5 2 SEG3 SEG6 SEG11 SEG16 SEG21 SEG22 SEG23 In Circuit Serial Programming M Connector ICSPDAT ICSPCLK MCLR 5 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 pins are dedicated connections to several components on the board The remaining 13 pins are
40. ers to integrating electronic controls into mechanical systems or replacing mechanical components with an electronic solution PIC microcontrollers are ideal for use in Mechatronic systems due to their small 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 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 2007 Microchip Technology Inc DS51557D page 7 PICDEM 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 co
41. ets 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 PIC USART or EUSART 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 2007 Microchip Technology Inc DS51557D page 15 PICDEM 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 the Back EMF must be scaled down into a range of 0 5 Resistor locations R55 and R56 are provided for this purpose These locations may be populated with resistors to create a simple voltage divider circuit TP 1 i
42. ht Sensor 182 yo 6 VDD R31 R36 2 E m VBAT 2 c1 RD7 30 4 1 ko GND 2700 L TSL251RD DO Ww 5 1 Vss 12 31 R10 10 5 1 Instructions Provide a light source for the light sensor and set Potentiometer 1 to the desired trip point Block the light source and LED1 should turn on Experiment with the set point and the amount to which you block the light from the sensor Move your hand slowly in front of the sensor and note that the LED does not flicker This demonstrates how software hysteresis prevents the output of the comparator from chattering near the trip point Discussion Comparators are found in many PIC microcontrollers due to the versatility and low cost they offer the user As you can see the comparator is one of the more easily used peripherals Refer to the Comparator Tips Tricks pamphlet included on the CD in this kit for more information on comparators DS51557D page 24 2007 Microchip Technology Inc Example Projects 2 3 3 Project 3 Thermometer Using the Analog to Digital Converter This project shows how to read an analog temperature sensor and display the temperature on a LCD The Analog to Digital Converter module is used to read the analog voltage output from the temperature sensor Then the resulting value is converted into degrees Celsius and displayed Objectives 1 Use the Analog to Digital Converter module on the PIC16F917 to read the analog voltage outpu
43. i 2007 Microchip Technology Inc PICDEM MECHATRONICS MICROCHIP DEMO BOARD USER S GUIDE Table of Contents tr EE DID PE PP LL PEN PP ED EP 1 Chapter 1 PICDEM Mechatronics 40501935 7 ya 7 1 3 Quick Start Guide cede Ga e RED RE ER 8 1 4 PICDEM Mechatronics Development Kit Contents 10 1 5 PICDEM Mechatronics msi 10 1 6 Required TOools i e eg 12 1 7 PICDEM Mechatronics 12 1 7 1 JUmper Settings manira oer edem te bte eid temet dans 12 1 7 21 5 e dete eden lta e M s 12 1 8 General PICDEM Mechatronics Demonstration Board Information 14 1 8 1 Experimentation issu 14 1 8 2 On Board Status LEDS 14 1 8 3 Over Current Protection Circuit 15 1 8 4 Motor GonnectlOn 2 e HI ete e ee 15 1 8 5 Serial Communication wima aweka 15 18 6 Snap Off Sensors M HO REL 16 1 8 7 Back EMF Scaling Resistors 16 1 6 8 Gurrent Sense ome tuaeque tais 16 1 8 9 Header Jumper Functions 17 Chapter 2 Example Projects 0 6 91 WA CELER 19 2 2 Loading Projects ur nue
44. ice programmers and the PICSTART Plus and PICkit 1 development programmers 2007 Microchip Technology Inc DS51557D page 5 PICDEM 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 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 MCU Communicator Revision C September 2006 Changed ANO to C1 Changed J2 to J1 Changed J12 to J13 Revision D September 2007 Added an LED note regarding JP8 in section 1 3 TROUBLESHOOTING See Chapter 3 for information on common problems __ a ____ _ __ DS51557D page 6 2007 Microchip Technology Inc PICDEM MECHATRONICS MICROCHIP DEMO BOARD USER S GUIDE Chapter 1 PICDEM Mechatronics INTRODUCTION The PICDEM Mechatronics is intended to be a learning tool for individuals interested in Mechatronic design Mechatronics ref
45. ight and center pins of JP8 using a shunt DS51557D page 42 2007 Microchip Technology Inc Example Projects JUMPER DIAGRAM PROJECT 9 FIGURE 2 19 peusnig 19 LINDYID ISNS AN3YHNO H3AO Linvs 258 10 a E LEN 754 Eod ana 8 90 em SSA YILANYYALNI 1VOILdO eo 225 985 Dee osina 14 22 2 22 noL9o zNv ov 1 v 2 oN oru sr 229 He fee e posco e eo eej je 225 1422 524 924 Celle L1 sn Gry vad d e e 224 e e6pug ss A 2 09 ej 5 0935 08 o M 193s 184 wA an 935 285 5935 85 e ON09 va 109 585 10 2 521 55 2 lt eir of oas 6nv zoy X snv sou X dla znv cou 1 022 728 14 1429 594 ere ee X QNono svs o 9n 4 lee e 3S dqowzos le 20210 110 e 22 e 05011 998 10 9n gt e 0 ens e 050 e 50
46. ight to sue for relief under that Act Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications MICROCHIP MAKES 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 FITNESS FOR PURPOSE Microchip disclaims all liability arising from this information and its use Use of Microchip devices in life support and or safety applications is entirely at the buyer s risk and the buyer agrees to defend indemnify and hold harmless Microchip from any and all damages claims Suits or expenses resulting from such use No licenses are conveyed implicitly or otherwise under any Microchip intellectual property rights QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV ISO TS 16949 2002 Trademarks The Microchip name and logo the Microchip logo Accuron dsPIC KEELOQ KEELOQ logo microID MPLAB PIC PlCmicro PICSTART PRO MATE rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U S A and other countries AmpLab FilterLab Linear Active Thermistor Migratable Memory MXDEV MXLAB SEEVAL SmartSensor and The Embedded Control Soluti
47. imulator Editor User s Guide DS51025 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 Acrobat pdf format R A 4 i Pn DS51557D page 4 2007 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 5 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 Microchi
48. 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 DO J14 Watch what happens to the intensity of LED DO as you turn the potentiometer DS51557D page 8 2007 Microchip Technology Inc PICDEM Mechatronics QUICK BOARD SETUP FIGURE 1 1 Linvs 19 NIYII 3SN3S 90 GIRO 9 uan INI ENS m cio via Nee ee oe tiNv s8u oas 6Nv Los z ss jm 1 19501 15 01 Nv E 95 m s NB m mug aid aNv zou LE GMS jm em EN NIZO ENV LOU 3 1 022 708 75 BBI 9
49. ive to one another then the stepper motor will have constant torque as it turns This results in a very smooth rotation of the shaft Applying current to the windings in this way is referred to as sine cosine microstepping Objectives 1 Single step a stepping motor 2 Half step the motor 3 Micro step the motor Applicable Technical Documents Stepping Motor Fundamentals Application Note AN907 DS00907 Stepper Motor Control Using the PIC16F684 Application Note AN906 DS00906 Jumper Configuration ANO J13 to POT1 J4 RAA J13 to SW2 94 RD7 J10 to P1 J1 RD6 J10 to P2 J1 RD5 J10 to P3 J1 RD4 J10 to 91 1 310 to PWM1 J1 J10 to J1 Place three shunts two pin jumpers vertically on J2 where it is labeled Connect for Full Bridge Place three shunts two pin jumpers vertically on J3 where it is labeled Connect for Full Bridge Connect the BROWN lead of the stepper motor to Drive 1 P9 Connect the ORANGE lead of the stepper motor to Drive 2 P10 Connect the RED lead of the stepper motor to Drive 3 P12 Connect the YELLOW lead of the stepper motor to Drive 4 P11 Connect the right and center pins of JP8 using a shunt 2007 Microchip Technology Inc DS51557D page 35 PICDEM Mechatronics Demo Board User s Guide JUMPER DIAGRAM PROJECT 7 FIGURE 2 14 5088 4 SGH 964 MOJ
50. l 43 7242 2244 39 Fax 43 7242 2244 393 Denmark Copenhagen Tel 45 4450 2828 Fax 45 4485 2829 France Paris Tel 33 1 69 53 63 20 Fax 33 1 69 30 90 79 Germany Munich Tel 49 89 627 144 0 Fax 49 89 627 144 44 Italy Milan Tel 39 0331 742611 Fax 39 0331 466781 Netherlands Drunen Tel 31 416 690399 Fax 31 416 690340 Spain Madrid Tel 34 91 708 08 90 Fax 34 91 708 08 91 UK Wokingham Tel 44 118 921 5869 Fax 44 118 921 5820 06 25 07 DS51557D page 60 2007 Microchip Technology Inc
51. l Converter Project 4 Digital Clock Using Timer1 Project 5 Brushed DC Speed Control with Optical Encoder Feedback Project 6 Brushed DC Speed Control with Back EMF Feedback Project 7 Stepper Motor Control Single Stepping Half Stepping and Microstepping Project 8 PC Interface Using the USART PIC16F690 Project Project 9 Brushed DC Motor Control Using the ECCP DS51557D page 20 2007 Microchip Technology Inc 2 3 1 Example Projects Project 1 Hello World Light a LED When learning to use a new computer language the first practical lesson traditionally instructs the user how to print Hello World on the screen Staying with tradition this project will make your PICDEM Mechatronics Demo Board say Hello World in the most practical way a microcontroller can lighting a LED Objectives 1 Use the PIC16F917 to read tactile switch input 2 Implement switch debouncing 3 Toggle a LED when a switch is pushed Applicable Technical Documents PICkit 17 Flash Starter Kit User s Guide 0540051 Exercise 2 Jumper Configuration 7 J10 to 00 J14 J13 to SW2 FIGURE 2 2 PROJECT 1 JUMPER DIAGRAM J10 E OR HMS OR HS NEN LI fr 7 1csP0aT RAN e 55 cow e
52. motor at half speed by setting POT1 to 50 and do the comparison again Note Different motors have different speed characteristics The motor used atthe time this manual was written may be different from the motor shipped with your PICDEM Mechatronics Demo Board Verify that the motor data sheet included on the CD ROM matches the motor on the board If they are different go to Microchip s web site for updates to this project Discussion Back EMF is typically not as accurate as speed feedback from an optical encoder However in many applications the accuracy does not have to be very precise and measuring Back EMF is more cost effective than any other speed feedback mechanism DS51557D page 34 2007 Microchip Technology Inc Example Projects 2 3 7 Project 7 Stepper Motor Control Single Stepping Half Stepping and Microstepping This project demonstrates the various ways to drive a bipolar stepper motor There are several ways to step a stepper motor the most basic of which is single stepping or moving the motor one step increments If a motor is specified as 7 5 degrees per step motor then single stepping the motor will result in moving the shaft of the motor 7 5 degrees per step Half stepping the same motor would result in a 3 75 degrees step Torque and current are linearly related for a stepper motor Therefore if two sinusoidal currents are applied to the windings offset by a 90 degree phase shift relat
53. n motor Finally the current in the motor windings is being controlled in a way that prevents the motor from running outside its rated current thereby eliminating the excess heat associated with half stepping The drawback to microstepping is that the drive circuitry is more complex EEE E M M MX M DS51557D page 38 2007 Microchip Technology Inc Exam ple Projects 2 3 8 Project 8 PC Interface Using the USART Communicating with the serial port on a PC is a very useful tool Applications include a piece of test equipment that needs to interface to a PC or a design that uses the serial port during development to configure the device In this project the PIC16F917 will use the USART to receive commands from a PC application Another notable feature to this project is that the firmware implements an auto baud routine to sync up with the application Objectives 1 Use the provided PIC MCU Communicator GUI to manipulate the on the PIC16F917 2 Understand what an auto baud routine entails Applicable Technical Documents Asynchronous Communications with the PIC USART Application Note AN774 DS00774 Jumper Configuration Make sure there are no jumpers or shunts on JP2 RD7 J10 to DO J14 Connect a serial cable between the board and PC FIGURE 2 16 PROJECT 8 JUMPER DIAGRAM C39 RE2 SEG23 VDD 55 7 1051 RA6 T1050
54. nfigured 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 POT 1 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 Connect POT1 on J4 to C1 on J13 using a wire jumper Connect P1 on J1 to RD7 on J10 using a wire jumper Connect N2 on J1 to RD2 on J10 using a wire jumper Connect the right and center pins on JP8 using a shunt gt Note If either LED PWR ON FAULT flickers immediately after power on please remove and re insert the shunt on JP8 Board Power Up Supply power to the board in one of the following ways Connect a 9 12 Vpc 0 75 amp minimum supply using J9 see note below Connect a 9 12 Vpc 0 75 amp minimum supply to the P21 and P20 screw terminals Connect a 9 Vpc battery to the battery connector Connect a 5 Vpc 1 2 amp minimum supply to TP2 or TP3 Note The power supply part number is AC162039 see buy microchip com Packaged with the MPLAB ICD 2 the part number is DV164007 Demonstration Program Press CLR FAULT SW5 which
55. ochip has published application notes and other documents covering the applications in each of these projects These documents can be found on the provided CD ROM Any updates to the applicable documents are available on Microchip s web site Please reference these documents while exploring each of the projects Note See Section 1 7 PICDEM Mechatronics Setup for instructions on how to setup the board to its initial condition prior to doing projects 2007 Microchip Technology Inc DS51557D page 19 PICDEM Mechatronics Demo Board User s Guide 2 2 LOADING PROJECTS IN MPLAB IDE The firmware for the projects is arranged in corresponding project folders in the install directory for the PICDEM Mechatronics CD If you installed the CD in the default directory the firmware for Project 1 is located in CAPICDEM Mechatronics firmware Project1 Opening a Project 1 Start MPLAB IDE 2 n the menu bar choose File gt Open Workspace 3 Find the project folder 4 Open the mew file The project window for Project 1 is shown in Figure 2 1 FIGURE 2 1 PROJECT WINDOW iBixi LightLED mcp E Source Files LightLED asm El Header Files LightLED inc Object Files Library Files Linker Scripts Other Files 23 EXAMPLE PROJECTS PIC16F917 Projects Project 1 Hello World Light a LED Project 2 Dusk Indicator Using the Voltage Comparator Project 3 Thermometer Using the Analog to Digita
56. ons 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 dsSPEAK ECAN ECONOMONITOR FanSense FlexROM fuzzyLAB In Circuit Serial Programming ICSP ICEPIC Mindi MiWi MPASM MPLAB Certified logo MPLIB MPLINK PICkit PICDEM PICDEM net PICLAB PICtail PowerCal Powerlnfo PowerMate PowerTool REAL ICE rfLAB Select Mode Smart Serial SmartTel Total Endurance UNI O WiperLock and ZENA are trademarks of Microchip Technology Incorporated 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 2007 Microchip Technology Incorporated Printed in the U S A All Rights Reserved LA 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 design centers in California and India The Company s quality system processes and procedures are for its PIC MCUs dsPIC DSCs KEELOQ code hopping devices Serial 5 microperipherals nonvolatile memory and analog products In addition Microchip s quality system for the design and manufacture of development systems is ISO 9001 2000 DS51557D page i
57. ontrol enter PORTD in the label text field Enter 008 in the Addr field Finally toggle bit 7 using the T button under that bit The LED on your board should toggle on and off See Figure 2 18 FIGURE 2 18 PIC MCU COMMUNICATOR INTERFACE lt PIC MCU Communicator Ver 2 1 0 T iB xl File Label Add Data H mes r OpenComm Baud Rate 1 4 300 4800 m m 2 9600 Comm Port m COMI x D Bit Control bur 53 0 PORTD eos WA TE EEE __ _ _ _ lt lt lt DS51557D page 40 2007 Microchip Technology Inc Example Projects Discussion The firmware for this project implements RS 232 communication between the PC and PIC16F917 The USART is used to perform this communication If a crystal oscillator were used as the clock source for the PIC16F917 auto baud would not be necessary However because the PIC16F917 is using the internal RC oscillator it is necessary to perform auto baud Auto baud refers to sending out a known character from the PC the MCU measures the time it takes to receive the character interprets this time into bit width and then sets up the baud rate registers accordingly for the USART This method allows the RS 232 communication to be free from errors on different microcontrollers and over temperature variations
58. operly configured for the projects DS51557D page 12 2007 Microchip Technology Inc PICDEM Mechatronics FIGURE 1 3 CONNECTING THE MPLAB ICD 2 TO THE PICDEM MECHATRONICS DEMO BOARD gt gill WA 4 ewe NE FIGURE 1 4 CONNECTING THE PICkit 2 TO THE PICDEM MECHATRONICS DEMO BOARD 2007 Microchip Technology Inc DS51557D page 13 PICDEM Mechatronics Demo Board User s Guide 1 8 GENERAL PICDEM MECHATRONICS DEMONSTRATION BOARD INFORMATION Power Supply Maximum Ratings Supply voltage 12 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 MOSFETs 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 MAY BE DAMAGED if proper design
59. p 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 C compilers MPASM and MPLAB 5 30 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 IDE The latest information on Microchip MPLAB IDE the Windows 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 II dev
60. pplication Note AN615 DS00615 Jumper Configuration T1OSI J13 to OSI J4 See note 1080 913 to OSO J4 See note RA3 J13 to SW2 J4 4 J13 to SW3 J4 5 J13 to SWA J4 FIGURE 2 8 PROJECT 4 JUMPER DIAGRAM RCS CCP1 RC4 SEG11 RD3 SEG1 RD2 CCP2 D Note Crystal circuits are very sensitive to noise and stray capacitances In general the traces between a crystal and a microcontroller should be as short as possible The reason the PICDEM Mechatronics Demo Board strayed from good design practice was to give you the option to use pins and for other functions 2007 Microchip Technology Inc DS51557D page 27 PICDEM Mechatronics Demo Board User s Guide FIGURE 2 9 PROJECT 4 SCHEMATIC VDD 11 32 PIC16F917 LCD1 13 e COMx Common pins L c35 T1OSI Y1 22 pF 32 768 kHz SEGx Segment pins 4 14 11080 VIM 332 DP 2 C34 VDD 5 R4 R8 3 sw2 10 10 KQ 200 R5 R9 RAO 5 655 1 1 i 0 oe ake all R6 1 KWA 10 1 Instructions Use Switch 2 to set the hours and Switch 3 to set the minutes Pressing and holding either of these switches will make the hours or minutes increment at a fast rate Toggle between displaying the
61. provide motor speed feedback In this project another form of speed measurement will be explored Back Electromotive Force Back EMF You may be aware that a Brushed DC motor when turned by hand will produce voltage at its leads becoming a generator When a Brushed DC motor is being driven and then the drive voltage is removed for a brief amount of time the voltage generated by the inertia of the motor will be proportional to its speed This voltage is the Back EMF Objectives 1 Effectively read Back EMF using the on board Analog to Digital Converter 2 Interpret the Back EMF into a speed for the motor Applicable Technical Documents Low Cost Bidirectional Brushed DC Motor Control Using the PIC16F684 Application Note AN893 DS00893 Jumper Configuration RD7 J10 to P1 91 CCP2 J10 to N2 J1 ANO J13 to POT1 J4 AN1 J13 to BACK EMF 916 Attach the motor leads to DRIVE1 P9 and DRIVE2 P10 J2 and J3 should be unpopulated Connect the right and center pins of using a shunt _ _ _ s X M M qr DS51557D page 32 2007 Microchip Technology Inc Example Projects JUMPER DIAGRAM PROJECT 6 FIGURE 2 12 peusnig 111 553 cia 10 vsu fiz 3SN3S AN34HNO H3AO mi T EN 9 MOVE 331903431 1VOILLdO a
62. s the output of this voltage divider See the schematic in Appendix A Hardware Schematics for further clarification 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 en lt lt DS51557D page 16 2007 Microchip Technology Inc PICDEM Mechatronics 1 8 9 HEADER JUMPER FUNCTIONS TABLE 1 1 HEADER JUMPER FUNCTIONS Headey Description Jumper Ji Output MOSFET drive pins J2 Full bridge drive circuit Drives 1 and 2 Place three shunts vertically on these pins to create a full bridge drive circuit incorporating Drives 1 and 2 J3 Full bridge drive circuit Drives 3 and 4 Place three shunts vertically on these pins to create a full bridge drive circuit incorporating Drives 3 and 4 Temperature sensor light sensor potentiometers 32 768 oscillator switches signal pins 45 Right side signal pins of the 20 pin DIP socket 92 pins 11 20 Left side signal pins of the 20 pin socket U2 pins 1 10 J7 Optical interrupter feedback signal pins J10 Right side signal pins of the 40 pin DIP socket U1 pins 21 40 J13 Left side signal pins of the 40 pin DIP socket U1 pins 1 20
63. t of the TC1047A temperature sensor 2 Gain knowledge about the LCD module and using the LCD module worksheet Applicable Technical Documents Precision Temperature to Voltage Converter TC1047 A Data Sheet DS21498 Jumper Configuration ANO J13 to TEMP J4 FIGURE 2 6 PROJECT 3 JUMPER DIAGRAM 2 RB7 ICSPDAT RB6 ICSPCLK RCS CCP1 RC4 SEG1 RD3 SEG1 RD2 CCP2 FIGURE 2 7 PROJECT 3 SCHEMATIC VDD PIC16F917 LCD1 Temp Sensor 1132 Von 1 Common VDD R19 Out 2 A e 2 ANO pins 0 1 uF 3 1 Vss C28 T 0 1 pF L e TC1047A ale Segment ins JL 12131 Vss VIM 332 DP L 2007 Microchip Technology Inc DS51557D page 25 PICDEM Mechatronics Demo Board User s Guide Instructions The LCD displays a temperature reading in degrees Celsius Breathe on the temperature sensor or introduce another heat source The displayed temperature should rise Move the jumper wire from the temperature sensor to the potentiometer POT1 on J4 Move the potentiometer to view the full range of temperature conversion Discussion The project introduces you to use of the Analog to Digital Converter module One of the biggest advantages to using a PIC microcontroller in applications that require temperature sensing is that the microcontroller can be used to calibrate
64. 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 DS51557D page 14 2007 Microchip Technology Inc PICDEM Mechatronics C39 D D1 D2 b3 04 05 06 07 z J13 He ci 6 0 10 GO s csrc Je D 0 2 0 0 0 c2 nj 10 RB5 COM1 NE c2 e ssccove 9 1 0 10 3 lt 10 cio ens 10 R41 C20UT 5 1 5 lt 1 100 R42 1 REe sec21 frs seco 43 Connect for 75 5 22 oB vo E FUI Blidge US NN RE2 SEc23 vs 1 vo R07 v um J4 cs um 42 um 1 5 Ros r0 wm jum LIGHT rA5 112 0 RD4 45 POT env ecr ee 2
65. tional When Microcontrollers Are Installed In Both U4 And U2 i e e Qui 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 T Introduction tei ot 49 Appendix B LCD Segment Mapping Worksheet BA INTOAUCUON E 57 Worldwide Sales and Service 444440 60 DS51557D page iv 2007 Microchip Technology Inc PICDEM MECHATRONICS MICROCHIP 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 IDE on line help Select the Help menu and then Topics to open a list of available on line help files
66. uaun 2 79 2160 pue 34560 LA4ISOW SL UOUMS 19594 pl Jojoeuuoo ni dSOI JIN9JI9 U Jo9euu09 491 721 eie LL 115 20 2 9977 OL Z 6 Josues 29 Josues eunjejeduig 7 eJempieu payeloosse jexoos Z Z SH 9 jexoos uid 0 eu uo suid 0 qo11ueufeseg lt 50418 suonoeuuoo pue pjeoq uO 26 00 22 920 0 0000099999 g 8 8 a 2 420 T Md Aer ONT paa 4 E DS51557D page 11 2007 Microchip Technology Inc PICDEM 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 You 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 REQ
Download Pdf Manuals
Related Search
Related Contents
医療機器の添付文書の記載要領の Électrovanne proportionnelle compacte LG 15-LW1R 15" LCD TV CEL-350 dBadge & CEL-352 dBadge `Plus` Manual do Utilizador Physical Layer Design for a Spread Spectrum Wireless LAN 例加 全自動洗濯機 AQUAMATーC8T 操作早見表 LES "DECHETS" ATOMIQUES PEUVENT ETRE UTILES ManualUtilizador Hikvision Digital Technology DS-2CD6362F-I surveillance camera Copyright © All rights reserved.
Failed to retrieve file