Home

F1 Evaluation Platform for Enhanced PIC MCUs User's Guide

image

Contents

1. 3381 199 LAON vem ng n L jn 28 gt e 8 2 pim 5 2 AldS AL der OGAZL 275 61 INVI1dWOO SHOY 34V S31N3NOWOO TIV m ozy AIBN3SSY MOION AJ 2i SIHL 404 WO8 NI SYJBNNN IYNLOY YJZBNNN TVNLOV 1084 434410 ATNO a 338 404 343H NMOHS SYJENNN SINYN 391430 ASEH 0 NI 34V SAMA JONVLIOVAVO 1 XG 5 NI 33V S3mwA 15153 03410345 3SIMYJHLO 5531 5310 22 5T MA ER TE 3SN3SI 81 71 18 52 6 0 Nd e 2334 3T ST nA adosi 1 dosli SINIOd 1531 TI O gore oT LL MH 9 7 438A Or 6 MT E MA gt 8 7 so Ors M 9 AT om NA 7 Y NH i n 7 T n r APER In ve ML I 4 Sly o ano 001 S 3SN3SI i 114 n v M 2 E 4 N HOLON A
2. TABLE 3 1 Pin Number Pin Name Pin Function Used Board Function 1 RC7 EUSART RX PICkit Serial Pin 1 2 RD4 Segment 17 LCD Pin 13 51 52 3 RD5 CCP1 Output B BLDC pin 5 Phase U low drive 4 RD6 CCP1 Output C BLDC pin 9 Phase V low drive 5 RD7 Segment 20 LCD pin 14 A V K Omega 6 Vss Vss Vss 7 VDD VDD VDD 8 RBO Segment 0 LCD pin 5 RC BATT AC 9 RB1 C12IN3 BLDC pin 19 Phase V BEMF Zero Cross 10 RB2 8 Potentiometer 11 RB3 C12IN2 BLDC pin 17 Phase U BEMF Zero Cross 14 RB4 COM1 LCD pin 1 Common 1 15 RB5 COM2 LCD pin 2 Common 2 16 RB6 PGC PICkit 2 ICSP pin 5 PGC 17 RB7 PGD PICkit 2 ICSP pin 4 PGD 18 MCLR MCLR PICkit ICSP Pin 1 19 RAO Segment 12 LCD pin 11 1A 1F 1E 1D 20 RA1 121 1 BLDC 15 Phase W Zero Cross 21 RA2 COM3 LCD pin 3 Common 3 22 RA3 C1IN BLDC pin 16 BEMF Zero Cross Reference 23 RA4 Segment 4 LCD pin 8 3B 3G 3C 3DP 24 RA5 Segment 5 LCD pin 9 2A 2F 2E 2D 25 REO REO LED D4 and BLDC pin 3 Phase W high drive 26 RE1 RE1 LED D3 and BLDC pin 7 Phase Uhigh drive 27 RE2 RE2 LED D2 and BLDC pin 11 Phase V high drive 28 VDD VDD VDD 29 Vss Vss Vss 30 RA7 Segment 2 LCD pin 7 3i RA6 Segment 1 LCD pin 6 DH RH B C 4DP 32 RCO T10SCO 32 768 kHz Crystal Drive 35 RC1 T1OSCI 32 768 kHz Crystal Drive 36 RC2 CCP1 Output BLDC pin 1 Phase W low drive 37 RC3 MSSP SCLK MCP9800 SCLK and Se
3. ava NOLLdIYDSIG SALON YSN NI 3QvW N33390SX IS 2010 Microchip Technology Inc DS41401B page 34 Schematics BLDC Add On Schematic 1 of 3 7 1 4 53001538 TIY 30 3334 38 TIVHS Q3HSINIJ SNIYAJLYN 40 445 SIN3NOdNWOO 31910404 ANON 51333205 3310034 SIN3NOdNOO 353 1 Y N 0339X3 OL LON 1H9I3H IN3NOdWOO WAOWIXVN V N 40 HLON31 V OL 38 TIVHS SQV31 TI 430 10S 40 1344 38 TIVHS SQvd 1N3NOdNNOO 5 11 Javog 3HL OL HSN14 GALNNOW 38 TIVHS SIN3NOdNOO TI 13193 5 1015 401 1 NO G4LNNOW SIN3NOdWOJ TI INYITHWOJ 33V SLNANOdNOO TI v O N N v v 553 INN 53 LON A lg ASSV 395401 5 LSSc 15 H9018 Wi3L 5 3Sn4 8 ONY 53504 2414 IIS 401 UU nn A M OA dlH2OHDIN SOION 158 sl a 2 5 gt 3 2 2 5 gt a 8 2 5 5 gt 3 9 T 2 DS41401B page 35 2010 Microchip Technology Inc F1 Evaluation Platform User s Guide BLDC Add On Schematic 2 of 3 7 1 5
4. 11 LCD controller 11 Eun 11 Hardware Libraries amp Drivers 21 2010 Microchip Technology Inc DS41401B page 39 F1 Evaluation Platform User s Guide R denim amende Mt na derine N V 18 iplc III 18 se E ee ers 18 RETA sise mir ee 18 Mer 18 Reading 7 7 REAL ICE in circuit emulator 17 S Segment 18 Sensorless BLCD add on 12 Supply voltage 13 T TIOSGO ux RII 18 18 U Userinienace nd 16 Pot ADC value 16 PREM Ie 16 Temperature 16 ERE 16 W Warranty Registration 7 WWW 8 XLPHOWIPOWB T ttd e 11 HEEL D
5. 19 Cip nC 18 Common Problems PIC microcontrollers e 11 Customer Notification Service 8 PIC16 series 11 Customer Support 9 PIC16F1 Evaluation 11 D PICT16F1 family ien nine 11 PIC TOL F1937 uhr 11 Documentation PICkit ICSPTM programming capability interface 17 Conventions 6 PICkit Serial uen 14 EAVOUt 5 Serial 14 E PICkit Serial power 14 Enhanced midrange microcontrollers 11 PICkit pH 17 EUSART 18 ceu ERES 17 Platform Contents 11 F F1 Evaluation Platform Demo Board 11 F1 Evaluation Platform 11 Powering with PICKit 3 13 F1 Evaluation Platform Schematic C 32 JP1 pP ES 13 NA cete e ere 13 H PICkit ICSP connector 14 Hardware Features 2 11 Voltage dinde te Du ee emis 14 16 bit timers ent seed 11 Programming and debugging 12 32 MHz internal oscillator 11 en a 11 EEPROM 11 Enhanced USART
6. vs zr Ni v odd d yi Z222NZ ZZZZNZ 2 Z222NZ N BOLO E T SE 010 z E E 2 42 927850 n j m ory 92859 S 1924 m szvgsa d X m va 923 sote 2 8 228 98 9 8 95 LE egt viu wee Z222NZ aL KAA KANA 39051 Ai 90 AT 0 gt gp 19 91H 94 ED szegsad 5 6 98 6159504 815950489 ST pel a 0 20 LOLH MO cuu ose 05 3190 18 919 vy HOLON AJ HOLON A HOLON AJ HOLON AJ XWA AZL YOLON 310N 2010 Microchip Technology Inc DS41401B page 36 Schematics DS41401B page 37 6000 ON 6 02170 SPA 8 a 49070 00 0 5 9 09070 00 0 ON 6500 00 0 SPA 87070 diuo0J9IN eq 0409141924 au Kuy 00 0 SPA s vo o 7 cooo SPA 9 800 pajosipu epis eui uo 2 SOM god 594 8 A EGLZO GO ON 38S HIOMHID esn 00 0 SPA L 02070 pepi o4d eu 1 eui
7. 1y10s e Vemm 72 7 _ Eo re QA 37100 vbd OL 41X261 9101d SA NI H3ROd M S l 5255 02938 8 542 014 098 104 in 193 222935 19 LOSO 6193S v LS40 0Ld 904 908 Pa Us ova TET dYOA 193S Z9S0 90a 81938 61540 814 508 sa 804 ZE 824 14211 025011 092 4 19385 715d49 02d4 w03 2 ra SE 8935 10 108 lt y 1 3 N amp 558892466 Ha 840220 5403 15 20060605 51222285855 NITYJMOJ 255599095 50898355004 N 2 gt 22 Qr ma T mere c ku Ju ku Te ka 001 ZHMSB9L ZE lt le le k 52 55 IS l 2 1 Es A cy 28 E 445 M01 15 81818188 8 1 1 a 72 9 _ 6882 18 ASS OL 39NYHO 8 vp tU 6007 70 5100 0 9505155 3499 5 003 34 DS41401B page 33 2010 Microchip Technology Inc F1 Evaluation Platform User s Guide F1 Evaluation Platform Schematic 3 of 3 7 1 3 diu20421N AJ eq suonp pajosipu epis pepi o4d ON 24 pajpoo 8 Jusjpainba 10 41 89Z 2193 29005 4ed
8. 9 F1 Evaluation Platform User s Guide NOTES DS41401B page 10 2010 Microchip Technology Inc 1 EVALUATION PLATFORM MICROCHIP USER S GUIDE Chapter 1 F1 Evaluation Platform Overview 1 1 INTRODUCTION Thank you for choosing the F1 Evaluation Platform This kit allows you to begin development using the PIC16LF 1937 microcontroller MCU The PIC16LF1937 is the first in a family of enhanced mid range microcontrollers These architectural ennancements allow for more memory and faster computation than that of legacy PIC16 microcontrollers PIC16F1 and PIC12F1 family of microcontrollers are a series of 8 bit microcontrollers derived from the popular PIC16 series of 8 bit PIC microcontrollers The F1 derivatives feature an enhanced CPU support for extended amounts of memory improved peripherals and XLP low power The F1 Evaluation Platform allows you to evaluate these features for your application in a simple low cost platform This chapter introduces the F1 Evaluation Platform Platform Contents Hardware Features 1 2 PLATFORM CONTENTS The F1 Evaluation Platform contains the following items 1 F1 Evaluation Platform Demo Board www microchip com F 1 Eval 13 HARDWARE FEATURES The F1 Evaluation Platform has the following hardware features 1 3 1 PIC16LF1937 PIC16LF1937 is a 40 pin full featured device including Enhanced PIC16 instruction set 8K Words of Flash memory 512 bytes
9. 10 bcd digitl t 10 t 10 bcd digit2 t 10 10 bcd digit3 t 10 lcd display digits 5 7 23 lcd display on lcd display off These two functions simply turn the LCD peripheral off The 1 oscillator is left running One use for these functions is to implement display blinking FIGURE 5 9 void update blinking if time 0 2 if an odd number of seconds led display on lcd display off 2010 Microchip Technology Inc DS41401B page 25 F1 Evaluation Platform User s Guide 5 7 3 LCD Segment Definitions FIGURE 5 10 LCD DISPLAY DH 52 MILLI VOLT BATT MINUS AMPS n OHMS DP4 DP3 DP2 MEGA KILO There are many segments present on the F1 Evaluation Platform LCD To access these segments simply set the supplied defines to 1 or 0 FIGURE 5 11 void display volts int v display int DP3 0 DP2 0 51 0 52 0 5 0 VOLT 1 KILO 0 OHMS 0 5 8 USING THE RTCC DRIVER RTC driver simply keeps track of seconds The power up initial value is 0 however a function rt cc set is provided to change that value To keep the seconds up to date the function rtcc handler must be called more frequently than the defined value of CLOCKS PER SECOND There are two options for the RTCC driver The first option is to use the Timer1 counter to provide
10. eq 0 sajo ca ON 9u1 4 SS DUIP Aq 0 sejoy 773 101 HUM 10109 UBAJIDSYJIS alge NA 3339 10109 0614 uejpainbe Jo 141 002 2183 spuJeplos 90061 62 0 18PIOS P8I8A8T JIv 10H OGOWS 4eddoo 404 1840 spuuepios X OB 9 UOISJSLULY M BH 1 aa HSW14 Pup e QZ lt PIO9 I9 gt 9 N LA m x pejojd eq 04 Joyo9uuoo 24255 7 2 6 X 00 SALON 33S DA 0692 plo9 1 HSINIA 3915 ee r ud SN 3QvN boa d puondo SI epixo NIJY40SM 15 AE SN UA SJ9AD J8UU uo esn SI p4poq JI 799 sseuxotui peusiul4 301 9 Y GI 44N YVAN SJe D JUBISM no ZO 848 jpuuexe 9 n2 eouppeduu 2 9 01 Z 1940 1NW qua DAINDF 40 y Y4 YHOLETOJ 0108 9009 V dI ISNY 494 god Z 5510 P Jo S 9 9 0 SIYL SILON BLDC Add On Schematic 3 of 3 7 1 6 2010 Microchip Technology Inc F1 Evaluation Platform User s Guide NOTES DS41401B page 38 2010 Microchip
11. RON User interface with button and pot For the latest firmware go to www microchip com F 1 Eval 2 7 1 Blinking LEDs The 4 LEDs indicate motor phase operation D lt 2 4 gt and the performance of the primary state machine loop D1 2 7 2 Measuring the Ambient Temperature The MCP9800 is polled when in Temperature Measurement mode The measured temperature is filtered scaled to centigrade and displayed on the LCD 2 7 3 BLDC Motor One task of the demo code is to drive a BLDC motor attached to the BLDC Expansion Header The optional BLDC Controller board DM164130 2 is required to drive the motor The code performs a series of forced commutation steps to attempt a sensorless motor start If no back signal is detected the code repeats the start up sequence The LEDs blink at an increasing rate indicating the motor start attempts If no motor drive hardware is attached this pattern can repeat or it may detect a BEMF signal in the noise present on the BEMF sense inputs 2010 Microchip Technology Inc 0 41401 15 F1 Evaluation Platform User s Guide 2 7 4 LCD Display The time temperature pot position and motor speed are displayed on the LCD The LCD is a 3 5 digit multimeter display with icons for amps volts ohms etc The display uses 4 commons and 10 segment drives The Timer1 oscillator is used to clock the display peripheral and allow the LCD to display data even in Sleep The LCD peripheral was
12. state machine had a RAM corruption and the default case caught the failure This will infinite loop so you should never see it The data completion flag for an 2 request is of type 12C RESULTS This flag will be 12 REOUEST PENDING until the request is complete If the request completed without errors the value will be 12C REOUEST COMPLETE If there were errors the value will reflect one of the other 4 error conditions 5 6 1 2 12C T The 2 Tis a structure representing one transaction on the 12 bus A transaction contains the following elements 1 7 10 bit address Address type is determined automatically by the driver R W mode is implicit in the address and specified by bit 0 2 An8 bit baud rate This is the value placed in SPADD Predefined constants are included that compute the SPADD value given an FOSC value Set FOSC with a define before including the 12 file 3 Abuffer length This is the number of bytes available for reading or writing at the supplied data buffer 4 A Buffer Pointer Your application will allocate a block of memory for an 2 transaction Pass a pointer to this block via the Buffer Pointer The block must remain valid until the transaction is complete if you allocate the block as a non static array within a function you must not leave the function until the 12C transaction is complete or th
13. 5 Hardware Libraries and Drivers osi AA AAA IA 21 DD IEC DAME Red 21 5 3 MG P9800 Driver 21 21 Mcr 21 5 6 Using the IC Driver sconto dete deca 22 5 7 Using the LGD Grivel cem 24 5 8 Using the RTOC Driver s de 26 5 9 Using the MCP9800 Drivers 27 Chapter 6 Troubleshooting 6 1 Introduction iii 29 6 2 Comripti PEODIeITIS uiii dus dec rola anne does 29 2010 Microchip Technology Inc 0 41401 3 F1 Evaluation Platform User s Guide Chapter 7 Schematics FS M UU 31 39 Worldwide Sales and Service 42 EE DS41401B page 4 2010 Microchip Technology Inc MICROCHIP F1 EVALUATION PLATFORM USER 5 GUIDE Preface NOTICE TO CUSTOMERS document 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 05
14. 66 2 694 1350 EUROPE Austria Wels Tel 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 08 04 10 DS41401B page 42 2010 Microchip Technology Inc
15. brushless DC motor connected to the PIC16F1 BLDC Expansion board DM164130 2 Other motors can also be driven by making appropriate modifications to the motor control parameters in the source code Refer to application note AN1305 Sensorless 3 Phase Brushless Motor Control with the PIC16FXXX for detailed information regarding BLDC motor control 4 5 COMBINED DEMO The combined demo combines all the software from all the previous demos to show the power of the PIC16LF 1937 In this demo the BLDC motor is seamlessly controlled while displaying the time temperature potentiometer position or motor RPM 10 All drivers are reused from the previous demos The RTCC is driven from the LCD peripheral The combined demo is preprogrammed in the F1 Evaluation Platform 2010 Microchip Technology Inc DS41401B page 19 F1 Evaluation Platform User s Guide NOTES 0 41401 20 2010 Microchip Technology Inc F1 EVALUATION PLATFORM MICROCHIP USER S GUIDE Chapter 5 Hardware Libraries and Drivers 5 1 INTRODUCTION All of the demo code uses a common set of libraries to provide real time clock MCP9800 and LCD services These libraries may be useful for other applications so they are documented here These drivers are located at www microchip com F 1 Eval 5 2 IC DRIVER The 2 driver allows reguests to be gueued and then handled either by interrupts or by polling The driver is configured during comp
16. configured for a Type B waveform for this demo This mode provides an interrupt when the LCD can be updated This interrupt is not required for Type A waveforms but the extra complexity of the interrupt allows the LCD peripheral to be used to provide the real time clock periodic interrupt The different waveform types are described in section 21 9 of the PIC16LF193X data sheet 0541364 Normally the Timer1 counter would be used but this timer is required for the BLDC software Because the LCD is clocked from the 32 768 kHz crystal the LCDIF operates at a multiple of the crystal frequency providing a very accurate time base for the real time clock 2 7 5 User Interface Due to the extreme simplicity of this board only a single button and a single pot are available for user input These two elements allow the user to cycle through the display elements change the motor speed and change the time Pressing and releasing the button cycles through the 4 display modes 1 Time 2 Temperature 3 Pot ADC value 4 RPM Turning the pot will change the motor speed or set the time If the display is showing the time and the button is held down for 3 seconds turning the pot clockwise will increase the time and counter clockwise will decrease the time Placing the pot in the center of the range will leave the time unchanged A feature that could be added as a simple programming exercise would be to allow the time change to be faster or slower depen
17. 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 is the document number and is the revision level of the For the most up to date information on development tools see the MPLAB IDE online help Select the Help menu and then Topics to open a list of available online help files INTRODUCTION This chapter contains general information that will be useful to know before using the F1 Evaluation Platform User s Guide Items discussed in this chapter include Document Layout Conventions Used in this Guide Warranty Registration Recommended Reading The Microchip Web Site Development Systems Customer Change Notification Service Customer Support Document DOCUMENT LAYOUT This document describes how to use the F1 Evaluation Platform User s Guide as a development tool to emulate and debug firmware on a target board The manual layout is as follows Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Revision History F1 Evaluation Platform Overview Getting Started Programming the F1 Evaluation Platform Demo Code Hardware Libraries and Drivers Troubleshooting Schematics 2010 Microchip Technology Inc DS41401B page 5 F1 Evaluation Platform User s Guide CONVENTIONS USED IN THIS GUIDE This manual uses the following
18. 1 Hz interrupt CLOCKS PER SECOND 1 The second option is to use the LCD write allowed interrupt flag to provide a 128 Hz event CLOCKS PER SECOND 128 The two choices are selected by defining use 1cdif or undefining use 1cdif 5 8 1 RTCC Function Interface 5 8 1 1 init Intialize the RTCC function including Timer1 if required DS41401B page 26 2010 Microchip Technology Inc Hardware Libraries Drivers FIGURE 5 12 System initialization rtcc init 5 8 1 2 handler The rtcc handler function must be called frequently to keep the internal seconds counter accurate FIGURE 5 13 System interrupt service routine If TMRIIF amp TMRIIE 0 rtcc handler 5 8 1 3 rtcc set After system initialization the seconds counter is cleared to 0 The standard C libraries equate 0 seconds to Midnight Jan 1 1970 That time has expired a long time ago so a new time in seconds can be configured with rt cc set FIGURE 5 14 finclude lt time h gt Time set set the time amp date to 1 second after midnight July 4 2009 struct tm time str time t unix time time str tm year 2009 the year i the month time_str tm_mday 4 the day of the month 0 the hour 0 23 time str tm mon 7 time_str tm hour time str tm min 0 the minutes time str tm se
19. 98835 25 POWERING WITH PICkit SERIAL To power with the Serial perform the following steps 1 Make sure a jumper or an ammeter is connected across JP2 2 If you are using BLDC expansion remove the jumper at JP1 3 Configure the PICkit Serial to supply a voltage between 1 8 and 3 6V For proper LCD contrast the supply should be 3 3V 4 Attach the PICkit Serial to the PICkit Serial connector at the top corner of the board 5 Activate the PICkit Serial power output DS41401B page 14 2010 Microchip Technology Inc Getting Started 2 6 POWERING WITH THE BLDC EXPANSION HEADER 43 The BLDC Expansion hardware contains a 3 3V linear regulator This allows the 5 12V motor power supply to power the PIC16LF 1937 43 pin 6 is the source for the 3 3V power To use this power perform the following steps Make sure a jumper or an ammeter is connected across JP2 Insert the shorting jumper at JP1 Verify that any attached PICkit or serial is not supplying power Verify that there is NO power supply or shorting jumper at JP3 Attach the BLDC expansion board Connect power to the BLDC expansion board Ogre qvo 2 7 DEFAULT FIRMWARE The default firmware supplied with your F1 Evaluation Board Demo performs the following functions 1 Blink LEDs Measure the ambient temperature Run a BLDC motor or try to if no motor is attached Display time temperature pot position motor RPM on the LCD
20. GUIDE Table of Contents AAA ASAS 5 Chapter 1 F1 Evaluation Platform Overview LA UGUO 11 1 2 Platform Contents CR ea 11 1 3 Hardware Features r ente ep eee ree Pa au 11 Chapter 2 Getting Started 2 1 reba 13 2 2 Powering the F1 Evaluation Platform 13 2 3 Powering with PICKkitTM SE SES eant ei 13 2 4 Powering with the Connector at 14 2 5 Powering with PICkitTM Serial ictor ettet 14 2 6 Powering with the BLDC Expansion Header J3 15 2 7 Befault Firmware ertet retreat na 15 Chapter 3 Programming the F1 Evaluation Platform j l lele le OD Sedo isi E ANNA 17 3 2 Programming Development Tool Support 17 3 3 Hardware Resources x dater 18 Chapter 4 Demo Code 451 ien ii e E eE iE a ELEA E 19 nen ca utri oet alite dad Pide HB eW 19 4 3 ECD BM O icd RR REDE Ren Gobbi tende tenore daa rur 19 AA BLDC DEMO otto 19 4 5 Combined Demo 19 Chapter
21. HOY SIN3NOdNWOO TI 40 NO 031419345 ASIMYSHLO 5541 5 10 55 god 40 3GISdOL NO G3INNOW ONY LP god 40 3GISdOL NO f Q3 TIVISNI MIS 401 W3O31V Id NOILYNTVAJ 14 dlH3042IW 222 24261391014 a 83 B go c in asuag L e 384881 is 901 PICkit Serial Q3TIVISNI 2010 Microchip Technology Inc DS41401B page 32 Schematics F1 Evaluation Platform Schematic 2 of 3 7 1 2 1 SHOY S31N3NOWOO TW 10 28UU09 9018 SIHL 404 WO8 NI SRM M 07 fer CHU exueisjey 0199 99U949J9 J 101495 YJANNN TYNLOV 334410 AVIN assis eva sr Mon 434 404 3H3H NMO
22. HS SYZANNNZSINYN 39130 9t ST CH L 9 SOVYV JOMOIN NI zi TT 234 A 508 1 75 SWHO NI 21 6 904 MOT A 1NIYYNO y S3NWA 3ONvISIS3M 031310395 ISIMYIHLO 5531 a 7 I33 HN nooo SA 7 say n 7 r NI 3MOd SALON E 033 M 198 2 Y Ld Zar 299 T ZON o1M 5 zr cer er 14 94 _ NI 43M0 dd czee WiA 021 3C 404 2 an a W Y ZS LS fi LIMOId d02 92 92 82 893 094 984 9 d94 84 06 46 32 0 SE Ie Y dO 9 9 8 5 wai ala 8 95 36 46 La DROLE 33M0d 2 4 2 2 8 5 9 4 2 24 084 m 2 004 rho ls E E NES le le gt Za 7 7 7 7 lt 12 2722 say 55555888665 2 784 gt gt gt gt DIS es 20222398922 255 sa Dax 034 Sad 08 834 5 900 m 7935 95 gt P001 25d0 6NY 284h7 134 40 58 zgow zsdo 8Nv z8H gt pm 7 5 vz i 274 10 1 0086 lt 40 cz C935 9Nv 038 1021 15 lt 0 01 LA s ES e 138 2935 9 138 093S 0Sd9 Z NV 0BM re 99 6 14238 5 993
23. MICROCHIP F1 Evaluation Platform for Enhanced Microcontrollers User s Guide 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 Digital Millennium Copyright Act If such acts allow unauthorized access to your software or other copyrighted work you may have a right to sue for relief under tha
24. MPLAB LINK30 object linkers and MPLIB and MPLAB LIB30 object librarians In Circuit Debuggers The latest information on the Microchip in circuit debugger MPLAB ICD 2 ICD3 PICkit 3 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 device programmers and PICkit 3 development programmers DS41401B page 8 2010 Microchip Technology Inc Preface CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels Distributor or Representative Local Sales Office Field Application Engineer 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 October 2009 Initial Release of this Document Revision B September 2010 Revised Figures 7 1 4 7 1 5 and 7 1 6 ENDE 2010 Microchip Technology Inc 0 41401
25. S41401B page 40 2010 Microchip Technology Inc F1 Evaluation Platform User s Guide NOTES 2010 Microchip Technology Inc DS41401B page 41 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 Cleveland Independence OH Tel 216 447 0464 Fax 216 447 0643 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 China Chengdu Tel 86 28 8665 5511 Fax 86 28 8665 7889 China Chongging Tel 86 23 8980 9588 Fax 86 23 8980 9500 C
26. Technology Inc MICROCHIP F1 EVALUATION PLATFORM USER S GUIDE Index Numerics 26 e at 19 IGSP PINS Nos ln ln 17 3 9 dlgit ua O 12 Internet Address 8 A L O Pen Kaba on a 17 LOD DI BL Rep il 19 Hit i in RENE tits 14 LCD Display nn RAI 16 B LCD Function Interface 25 led displavidrg 85524542 52205244 leka tk y re e C 25 BEMF Zero crossing 29 lcd display on lcd display off 25 BLDG Demo si iii ennemie 19 eer T do 25 BLDG expansion 14 15 BLDC motor 15 eM 18 C12IN3 k a dk de ja an aa aa don AA RR D CERRAR DR UE RR STOEL 18 MCP9800 tres 1 1 CEP Output A eret mera 18 Temperature 11 COPA Output Burn dade 18 Microchip Internet Web Site 8 CCP1 Output Css 18 MSSP O E EI E 18 Gentigrade eerie 15 MSSP ees 18 GOM T ne d ML Mu mn 18 COMPLOT 18 P COMBS a 18 Za 18 Combined Demo
27. The PIC16LF1937 has complete control of 3 phases so other 1 2 or 3 phase motor topologies can also be controlled 1 3 8 Current Monitoring Connector To demonstrate the Extreme Low Power XLP features of the PIC16LF1937 a precision ammeter can be connected to the current monitoring connector This allows your application to be easily optimized for the lowest possible current 1 3 9 Generous Prototyping Area Our circuits are not your circuits A prototyping area has been provided to extend the functionality of this demo board to demonstrate the utility of the PIC16LF1937 in your application DESE Ua AA UA aa EN DESE KDE EN ENE EDEN DS41401B page 12 2010 Microchip Technology Inc F1 EVALUATION PLATFORM MICROCHIP USER S GUIDE Chapter 2 Getting Started 2 1 INTRODUCTION This chapter gives instruction to get your F1 Evaluation Platform powered up and running the default demonstration The following sections include Powering the F1 Evaluation Platform Default Firmware Programming the F1 Evaluation Platform with the PICkit 3 e Attaching Serial optional Measuring the current consumption FIGURE 2 1 F1 EVALUATION PLATFORM DM164130 1 2 D amp v 2 2 POWERING THE F1 EVALUATION PLATFORM The PIC16LF1937 supplied with your F1 Evaluation Platform requires a supply voltage of 1 8V 3 6V Voltages above 3 6V will degrade or damage the device There are four way
28. ans 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 users guides and hardware support documents latest software releases and archived software General Technical Support Frequently Asked Questions FAQs technical support reguests 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 Hitech C16 MPLAB C18 and MPLAB C30 compilers MPASM MPLAB ASM30 assemblers MPLINK and
29. block and i2c read block functions are helpers that assemble a TRB insert it into the gueue and wait for the transaction to complete 2010 Microchip Technology Inc DS41401B page 23 F1 Evaluation Platform User s Guide FIGURE 5 4 Send one byte unsigned char data 2 write block ADDRESS 1 amp data 12 200K 5 6 2 5 i2c handler The 2 handler function must be called for each 12 state to be handled This function can be placed into the Interrupt Service Routine for your application or you can simply poll it often If the i2c write block or 12c read block functions are used when the driver is configured for polling then this function will repeatedly be called until the transaction completes FIGURE 5 5 Interrupt service routine i2c handler 5 7 USING THE LCD DRIVER The supplied LCD driver configures the LCD module for the pins used by the F1 Evaluation Platform Icon definitions are provided to simplify the software A BCD to 7 segment display mapping function is also provided to further simplify control of the LCD glass For more information concerning the LCD peripheral please consult the LCD chapter in the PIC16LF1937 data sheet 0541364 5 7 1 LCD Data Structures 5 7 1 1 BCD TYPE To simplify BCD to the 7 segment display mapping a BCD segment data type has been provided This data type is simply four 4 bit fields representing digits 0 1 2 an
30. c 1 the seconds time str tm isdst 1 daylight savings time modifier unix time mktime amp time str rtcc set unix time 5 8 1 4 time The standard C libraries require the application to supply the t ime function This function returns the current time t value or loads a supplied time t value The interrupts are saved and restored to make this function safe for use with interrupt driven code 5 9 USING THE MCP9800 DRIVER The MCP9800 is an 2 temperature sensor The MCP9800 driver provides a simple interface to the features in the sensor 2010 Microchip Technology Inc DS41401B page 27 1 Evaluation Platform User s Guide 5 9 1 MCP9800 Function Interface 5 9 1 1 mcp9800 init This function configures the MCP9800 for 12 bit temperature Continuous Conversion mode In this mode the temperature is always ready to be read from the 2 interface FIGURE 5 15 System init i2c_init mcp9800 init 5 9 1 2 mcp9800 get temp This function reads the current temperature and scales the result to degrees C 10 24 3C is returned 243 FIGURE 5 16 Thermostat int temperature temperature mcp9800 get temp if temperature gt 260 turn on air conditioner DS41401B page 28 2010 Microchip Technology Inc 1 EVALUATION PLATFORM MICROCHIP USER S GUIDE Chapter 6 Troubleshooting 6 1 INTRODUCTION There may come a
31. d 3 FIGURE 5 6 typedef union UINTI6 val struct unsigned digito unsigned digitl unsigned digit2 A A A unsigned digit3 BCD_TYPE Simply place the number you want displayed in each digit position and call led display digits Digit is the Most Significant 7 gt digit of the 3 5 digit LCD glass Therefore the largest value displavable is 1FFF assuming hexidecimal digits or 1999 for decimal digits DS41401B page 24 2010 Microchip Technology Inc Hardware Libraries Drivers 5 7 2 LCD Function Interface 5 7 2 1 led init This function configures the LCD peripheral for this board and this glass Type B waveforms are used to allow the LCD peripheral to be used for the real time clock function The oscillator is configured as the LCD clock source FIGURE 5 7 System initialize lcd init 5 7 2 2 lcd display digits This function accepts a BCD TYPE variable and maps each digit to the correct segments Mapping the segments is done in two stages First the digit is converted to the correct 7 segment mapping Then the 7 segment mapping is converted to the actual glass segments with a long series of if else statements This function will need extensive work in the if else statements for applications driving different glass FIGURE 5 8 void display int int t BCD TYPE bcd bed digitO t 10
32. ding upon pot position DS41401B page 16 2010 Microchip Technology Inc F1 EVALUATION PLATFORM MICROCHIP USER S GUIDE Chapter 3 Programming the F1 Evaluation Platform 3 1 INTRODUCTION The F1 Evaluation Platform makes extensive use of the onboard peripherals of the PIC16LF1937 This chapter provides guidance concerning the tools used for programming the F1 evaluation board and a map of the board function to I O pin and pin function 3 2 PROGRAMMING DEVELOPMENT TOOL SUPPORT The following development tools support the F1 Evaluation Platform 1 3 2 PICkit 2 3 REAL ICEM in circuit emulator with adapter AC164110 The PICkit tools can also power the F1 Evaluation Platform therefore no additional hardware is required to get started The ICSPTM pins of the PIC16LF1937 are dedicated to the PICkit ICSP connector eliminating interactions between the Evaluation Platform and the programmer debugger If you are developing with the REAL ICE emulator you will need the AC164110 adaptor or the high speed trace adaptor These adaptors provide the inline 6 pin connector required by the PICkit ICSP programming capability interface You will also need a power supply please see Chapter 2 Getting Started for more on powering the F1 Evaluation Platform 2010 Microchip Technology Inc DS41401B page 17 F1 Evaluation Platform User s Guide 3 3 HARDWARE RESOURCES
33. documentation conventions DOCUMENTATION CONVENTIONS Description Represents Examples Arial font Italic characters Referenced books MPLAB IDE User s Guide Emphasized text 5 the only compiler Initial caps window the Output window A dialog the Settings dialog menu selection select Enable Programmer Quotes A field name in a window Save project before build dialog Underlined italic text with menu path File gt Save right angle bracket Bold characters A dialog button Click OK A tab Click the Power tab N Rnnnn A number in verilog format 4400010 2 hF1 where N is the total number of digits R is the radix and n is a digit Text in angle brackets lt gt A key on the keyboard Press Enter F1 Courier New font Plain Courier New Sample source code define START Filenames autoexec bat File paths c mcc18 h Keywords _asm _endasm static Command line options Bit values 0 1 Constants OxFF A Italic Courier New A variable argument file o where filecan be any valid filename Square brackets Optional arguments mcc18 options file options Curly brackets and pipe Choice of mutually exclusive errorlevel 011 character arguments an OR selection Ellipses Replaces repeated text var_name var name Represents code supplied by void main void user DS41401B
34. doo 1810 vspwapjos X PIOB QZ lt pIO9 I9 gt 9 N pajojd eq I0YS suebulj 4012euuoo JeUUI YIDIJ S00 your 290 99uppeduy 5 20 soo al 2 x 02170 000 SPA vo o eds eu Kuy zooo SPA 266 EE 8 00 00 0 SPA leo o eu uo AIJUNO9 31021PUJ coool sex x 200 ZSLZO SO ON 195 WOMYD esf 00 zoQ4 saa 46 2109 101 04 DIG SICH 9199 e UM 10109 991954115 9349 10109 spuuepjos 95172 0999 1 110 A J9pJOS peje e JI 10H 1 1 4 UCISISLULU Ev ao HSV iniu 9 HSINIJ FI ludi d Sect s puodo si epixo uMoug tabu eoc e esn 4e Kp Ijjnuu SI A SSeUY9IU pausiul4 5 51940 nO 9015 uv z SJeKp 14 NI 44N HEVN x 1 Z 1940 US DAINbJ 40 44 4 0105 WIYSLVAN SALON 445 3GIS 70009 24 SNY god Z 55 12 D Jo 5 0 4 0 god 5141 60
35. e U S A Analog for the Digital Age Application Maestro CodeGuard dsPICDEM dsPICDEM net dsPICworks dsSPEAK ECAN ECONOMONITOR FanSense HI TIDE In Circuit Serial Programming ICSP Mindi MiWi MPASM MPLAB Certified logo MPLIB MPLINK mTouch Omniscient Code Generation PICC PICC 18 PICDEM PICDEM net PICtail REAL ICE rfLAB Select Mode Total Endurance TSHARC UniWinDriver WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U S A and other countries SOTP is aservice mark of Microchip Technology Incorporated in the U S A All other trademarks mentioned herein are property of their respective companies 2010 Microchip Technology Incorporated Printed in the U S A All Rights Reserved Printed on recycled paper ISBN 978 1 60932 512 1 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 lndia The Company s guality system processes and procedures are for its PIC MCUs dsPIC DSCs KEELOG 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 certified DS41401B page 2 2010 Microchip Technology Inc F1 EVALUATION PLATFORM MICROCHIP USER S
36. e array may be reused by a different function 0 41401 22 2010 Microchip Technology Inc Hardware Libraries Drivers 5 6 2 BC Function Interface 5 6 2 1 i2c_init The function i2c init configures the C driver and makes it ready to receive transaction in the transaction queue FIGURE 5 1 initialize i2c init 12C 400K 5 6 2 2 i2c insert The function 12c insert places one complete set of Transaction Request Block TRB s TRBs can be bundled into an array of multiple TRBs and inserted as one large request The driver will ensure that all the TRBs in the list will be processed sequentially with 2 restarts separating them FIGURE 5 2 Send data 12C TRANSACTION REOUEST BLOCK trb_list 5 I2C RESULTS flag populate the trb s 12 insert 5 trb list amp flag 5 6 2 3 i2c build write trb 12 build read trb The i2c build write and i2c build read trb functions are helpers to assemble the 12C TRANSACTION REOUEST BLOCKS from passed parameters FIGURE 5 3 Send one byte 12C TRANSACTION REOUEST BLOCK trb list unsigned char data 12C RESULTS flag data block my data byte i2c build write trb amp trb list ADDRESS 1 12 200K 12 insert 1 amp trb amp flag 5 6 2 4 2 write block i2c_read_block The i2c write
37. hina Hong Kong SAR Tel 852 2401 1200 Fax 852 2401 3431 China Nanjing Tel 86 25 8473 2460 Fax 86 25 8473 2470 China Gingdao 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 Wuhan Tel 86 27 5980 5300 Fax 86 27 5980 5118 China Xian Tel 86 29 8833 7252 Fax 86 29 8833 7256 China Xiamen Tel 86 592 2388138 Fax 86 592 2388130 China Zhuhai Tel 86 756 3210040 Fax 86 756 3210049 ASIA PACIFIC India Bangalore Tel 91 80 3090 4444 Fax 91 80 3090 4123 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 Kuala Lumpur Tel 60 3 6201 9857 Fax 60 3 6201 9859 Malaysia Penang Tel 60 4 227 8870 Fax 60 4 227 4068 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 6578 300 Fax 886 3 6578 370 Taiwan Kaohsiung Tel 886 7 213 7830 Fax 886 7 330 9305 Taiwan Taipei Tel 886 2 2500 6610 Fax 886 2 2508 0102 Thailand Bangkok Tel 66 2 694 1351 Fax
38. ilation to support polling or interrupts The I C and LCD demos configure the driver for interrupt mode The Combined demo polls the handler within the MCP9800 driver 5 3 MCP9800 DRIVER The MCP9800 driver uses the 2 driver to get the current temperature The 9800 get temp function is fully blocking so once a request is gueued the driver polls the 12 subsystem until the data is complete If the IC driver is operating without interrupts the mcp9800 get temp function repeatedly calls the 12C handler function to process all the 12 events If the I C driver is operating with interrupts the 9800 get temp function simply inserts an 12C TRANSACTION into the transaction gueue and waits for the transaction to complete 54 RTCC DRIVER A software RTCC is managed by the supplied RTCC driver This driver implements the time function required by the compiler Time is internally as seconds since January 1 1970 Standard C functions can be used to convert the time to the current date This driver has two modes ln the first mode it expects to be called once per second by the 1 interrupt In the second mode it expects to be called on every LCD mode frame This allows the RTCC to keep accurate time even if Timer1 is being used by some other function such as the BLDC motor driver 5 5 LCD DRIVER The LCD driver contains the initialization code required for the LCD peripheral and the mapping c
39. ode required to control the 3 5 digit LCD supplied with this demo board It is a good starting point for the LCD driver your unique application will require 2010 Microchip Technology Inc DS41401B page 21 F1 Evaluation Platform User s Guide 5 6 USING THE DRIVER The supplied software includes an I C Master mode driver with the following features Interrupt driven or polled Queued requests Minimum memory requirements Uses Restart to maximize bus bandwidth Multiple atomic IC transactions allowed at each queue entry 6 Completion flag for each queued block of IC commands 5 6 1 2 Data Structures Two data structures are defined to simplify interactions with the 12C driver 5 6 1 1 I2C_RESULTS_T The 12C RESULTS Tis an enumerated type with the following enumerations TABLE 5 1 I2C RESULTS 12C REOUEST PENDING Reguest is in the gueue or in process but it is not done 12C REOUEST COMPLETE The request is finished successfully 12C REOUEST STUCK START The reguest was aborted The start condition did not clear correctly 12C REOUEST ADDRESS NO ACK The reguest was aborted No ACK occurred on the address so the target device must not exist or is not functioning 12C REOUEST DATA NO ACK The reguest was aborted Not all of the data could be sent because the device did not ACK a byte 12C REOUEST LOST STATE The
40. of RAM 256 bytes of EEPROM 2 CCPs and 3 enhanced CCPs MSSP I C SPI Enhanced USART 8 and 16 bit timers 32 MHz internal oscillator 0 Low power 32 kHz crystal oscillator and 1 LCD controller 1 3 2 MCP9800 12 Temperature Sensor The MCP9800 is a low power temperature sensor with selectable 9 to 12 bits of output resolution 2010 Microchip Technology Inc 0 41401 11 F1 Evaluation Platform User s Guide 1 3 3 PICkit 3 Programming Debug Header The PICkit 3 is a low cost development tool that allows programming and debugging of the PIC16LF1937 using the ISCPTM header 1 3 4 PICkit Serial Communications Header The serial is a low cost development tool that allows KC SPI and USART protocols to be monitored and debugged through a simple 6 pin connector 1 3 5 1 Button 1 Potentiometer 4 LEDs Simple applications need the basic user interface elements The button potentiometer and 1 LED are available for any application The remaining 3 LEDs are shared with the 20 bit motor control expansion connector 1 3 6 One 3 5 Digit LCD The 3 5 digit LCD glass supplied on this board is a typical meter type display with icons for ohms amps etc The PIC16LF 1937 makes controlling the LCD very simple 1 3 7 20 pin Motor Control Expansion Connector This connector allows the PIC16LF1937 to control an optional Sensorless BLDC add on board DM164130 2
41. page 6 2010 Microchip Technology Inc Preface WARRANTY REGISTRATION Please complete the enclosed Warranty Registration Card and it promptly Sending in the Warranty Registration Card entitles users to receive new product updates Interim software releases are available at the Microchip web site RECOMMENDED READING This users guide describes how to use the F1 Evaluation Platform Other useful docu ments are listed below The following Microchip documents are available and recom mended as supplemental reference resources Readme for F1 Evaluation Platform User s Guide For the latest information on using F1 Evaluation Platform User s Guide read the Readme for F1 Evaluation Platform User s Guide txt file an ASCII text file in the Readmes subdirectory of the MPLAB IDE installation directory The Readme file contains update information and known issues that may not be included in this user s guide Readme Files For the latest information on using other tools read the tool specific Readme files in the Readmes subdirectory of the MPLAB IDE installation directory The Readme files contain update information and known issues that may not be included in this user s guide gt aE 2010 Microchip Technology Inc DS41401B page 7 F1 Evaluation Platform User s Guide THE MICROCHIP WEB SITE Microchip provides online support via our web site at www microchip com This web site is used as a me
42. rial pin 5 38 RDO Common 4 LCD pin 4 Common 4 39 RD1 RD1 LED D1 40 RD2 RD2 Button Input 41 RD3 Segment 16 LCD pin 12 1B 1G 1C 42 RC4 MSSP SDA MCP9800 SDA and PICkit Serial pin 4 43 RC5 Segment 10 LCD pin 10 2B 2G 2C 2DP 44 RC6 EUSART TX PICkit Serial pin 6 DS41401B page 18 2010 Microchip Technology Inc 1 EVALUATION PLATFORM MICROCHIP USER S GUIDE Chapter 4 Demo Code 4 1 INTRODUCTION The F1 Evaluation Platform demos are located at www microchip com F1Eval The following demos are available 1 Demo 2 LCD Demo 3 BLDC Demo 4 Combined Demo This chapter provides an overview to the functions provided by tnese demos 42 ICT DEMO The I C demo reads the current temperature from the on board MCP9800 12 temperature sensor The I C driver is used to extract the data The resulting value is converted to a PWM duty cycle and used to control the brightness of the LED D4 LED D1 toggles at approximately 10 ms 4 3 LCD DEMO The LCD demo adds button potentiometer Real Time Clock RTC and LCD support to the 2 demo The 32 768 kHz crystal is activated to maintain the Real Time Clock and to drive the LCD peripheral An input driver is supplied to manage the button and potentiometer A state machine now controls the major features of the demo so that the time temperature and potentiometer value can be displayed on the LCD 44 BLDC DEMO The BLDC demo controls a sensorless
43. s to supply the necessary power 1 Use PICkit 3 2 Use the power connector at JP3 3 UsePICkit Serial or 4 Use the BLDC Expansion Header J3 2 3 POWERING WITH PICkit 3 To power with the PICkit 3 perform the following steps 1 Make sure a jumper or an ammeter is connected across JP2 2 Ifyou are using a BLDC expansion remove the jumper at JP1 2010 Microchip Technology Inc DS41401B page 13 F1 Evaluation Platform User s Guide 3 Configure the PICkit 3 to supply a voltage between 1 8 and 3 6V For proper LCD contrast the supply should be 3 3V 4 Attach the to the PICkit ICSPTM connector at the end of the board 5 Activate the PICkit 3 power output 2 4 POWERING WITH THE CONNECTOR JP3 To power with the connector at JP3 perform the following steps 1 Make sure a jumper or an ammeter is connected across JP2 2 Ifyou are using a BLDC expansion remove the jumper at JP1 3 Verify the supply voltage to be between 1 8 and 3 6V For proper LCD contrast the supply should be 3 3V 4 Attach the power supply to JP3 5 Turn on the power supply FIGURE 2 2 POWERING WITH THE CONNECTOR AT JP3 70555528 3382335338 g gt year 5 5 oo gt 8 ey c 2 SEG17 8 3 SEG18 V SEG19 5 5 20 U3 PIC16F193XLF TOFP SEG VLCD1 MC s amp vLCD3 88 0055 ug 652 amp 59 5 23208633 2 235 29
44. t Act Information contained in this publication regarding device applications and the like is provided only for your convenience and be superseded by updates 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 MERCHANTABILITY OR 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 dsPIC KEELOQ KEELOQ logo MPLAB PIC PICmicro PICSTART PIC logo rfPIC and UNI O are registered trademarks of Microchip Technology Incorporated in the U S A and other countries FilterLab Hampshire HI TECH C Linear Active Thermistor MXDEV MXLAB SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in th
45. time when you need to determine why your F1 Evaluation Platform is not performing correctly This chapter lists a few of the problems that can prevent proper operation 6 2 COMMON PROBLEMS 6 2 1 The board will not power up Make sure there is no shorting jumper at JP3 Then go back and review Chapter 2 Getting Started of this manual 6 2 2 LCD is blank but everything else works The demo code in supplied with the F1 Evaluation Platform uses the Timer1 oscillator to drive the LCD If the Timer1 oscillator is not oscillating the LCD will remain blank Here are some steps to assure that the Timer1 oscillator is working properly 1 Clean and dry the board especially around the components at the top right corner of the PIC16LF1937 2 Make sure no foreign material is shorting the crystal leads 3 Ifyou are using the RCO and pins for some other function you should modify lcd init to reconfigure the LCD peripheral for a different clock source The Timer1 oscillator of the PIC16LF1937 is a very low power design that can be easily disrupted by stray leakage In an actual application Microchip recommends that the crystal circuit be conformal coated to prevent leakage Please review Application Note AN1288 Design Practices for Low Power External Oscillators for more information 6 2 3 The motor spins but then stops The BLDC start up algorithm could be having trouble finding the BEMF zero crossing signal required to synchroni
46. ze the motor commutation If you have attached the BLDC add on board and you are using the supplied BLDC motor then the pot labeled iRef needs to be turned completely counter clockwise to assure that a good BEMF zero crossing signal is detected by the PIC16LF1937 If you are using a different motor you need to adjust the zero crossing threshold to match the requirements of the motor For more information consult the documentation supplied with the BLDC add on board 2010 Microchip Technology Inc DS41401B page 29 F1 Evaluation Platform User s Guide NOTES 0 41401 30 2010 Microchip Technology lnc AN F1 EVALUATION PLATFORM MICROCHIP USER S GUIDE Chapter 7 Schematics 7 1 INTRODUCTION To help understand the features of the F1 Evaluation Platform and the BLDC add on board the schematics are included here 2010 Microchip Technology Inc DS41401B page 31 F1 Evaluation Platform User s Guide F1 Evaluation Platform Schematic 1 of 3 7 1 1 ACIS dOL NO GALNNOW SLNANOdWOO J10H HONOBHL TI SANGISIY 11 JO 3384 38 TIVHS QVOa Q3HSINIJ STVIH3IVIN 40 445 SLNZNOJWOD Q31VIndOdNn ANON 5137005 3310038 SINJ3NOdWOO 3 3 1 Y N 0110X141 OL LON LHOI4H LNANOdWOO WAWIXVN Y N 10 HLONAT WAWIXVW V OL Q3AWIN L 38 TIVHS 50731 TIV 443G10S JO 3334 38 TIVHS Sdvd LNSINOdNOD TI OL HSN14 GALNNOW 38 TIVHS SIN3NOdNWOO TI INVITGNOO S

Download Pdf Manuals

image

Related Search

Related Contents

Guida anidride carbonica del controller  Manual  Manual de instalación en formato PDF  

Copyright © All rights reserved.
Failed to retrieve file