PIC18F87J72 Evaluation Board User’s Guide © 2011 Microchip Technology Inc.
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.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Table of Contents Preface ........................................................................................................................... 5 Introduction............................................................................................................ 5 Document Layout .................................................................................................. 6 Recommended Reading...........................................................
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Appendix A. Schematics and Layouts A.1 Introduction .................................................................................................. 37 A.2 Board – Schematic 1 .................................................................................... 38 A.3 Board – Schematic 2 ................................................................................... 39 A.4 Board – Schematic 3 .....................................................................
PIC18F87J72 EVALUATION 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.
PIC18F87J72 Evaluation Board User’s Guide DOCUMENT LAYOUT This document describes how to use the PIC18F87J72 Evaluation Board as a development tool to emulate and debug firmware on a target board. The manual layout is as follows: • Chapter 1. “Product Overview” – Provides a brief overview of the PIC18F87J72 Evaluation Board, its features and uses. • Chapter 2. “Hardware Description” – Provides a detailed description of the PIC18F87J72 Evaluation Board hardware features. • Chapter 3.
Preface RECOMMENDED READING This user's guide describes how to use PIC18F87J72 Evaluation Board. Other useful documents are listed below. The following Microchip documents are available and recommended as supplemental reference resources. MPLAB® IDE Simulator, Editor User's Guide (DS51025) Refer to this document for more information on installation and implementation of the MPLAB Integrated Development Environment (IDE) software.
PIC18F87J72 Evaluation Board User’s Guide CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • • • • • Distributor or Representative Local Sales Office Field Application Engineer (FAE) Technical Support Development Systems Information Line Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Chapter 1. Product Overview 1.1 INTRODUCTION This chapter provides an overview of the PIC18F87J72 Evaluation Board. This board is used as a development tool and as evaluation kit for PIC18F87J72 based applications. Topics discussed in this chapter include: • Development Kit Contents • Evaluation Board Functionality and Features 1.
PIC18F87J72 Evaluation Board User’s Guide 1.3 PIC18F87J72 EVALUATION BOARD KIT CONTENTS This PIC18F87J72 Evaluation Board kit includes: • • • • • PIC18F87J72 Evaluation Board Pre-Programmed PIC18F87J72 microcontroller on board MCP2200 device on board GUI LAB VIEW installation software for the GUI - Visa 441 runtime - LVRTE86std • Mini Universal Serial Bus (USB) connecting cable DS51990A-page 10 © 2011 Microchip Technology Inc.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Chapter 2. Hardware Description 2.1 INTRODUCTION This chapter describes the various sections of the hardware present on the evaluation board. It also describes the different configurations possible for operating the evaluation board, depending upon the input voltage and current specifications. Figure 2-1 shows the overall layout of the PIC18F87J72 Evaluation Board where the different hardware sections are indicated by numbers.
PIC18F87J72 Evaluation Board User’s Guide TABLE 2-1: SI NO BOARD LAYOUT AND COMPONENTS Section or Component Functionality 1 PIC18F87J72 microcontroller Main controller for all functions on the board 2 Seven segment LCD To display time and other configuration features like OSR, Gain, Bit Width 3 High voltage section with connectors For connecting universal input voltage to the board (when not using 9V supply or battery) 4 RJ11 connector For debugging and programming purpose 5 Load Cell connec
Hardware Description 2.1.2 Measurement of High Voltages The circuit diagrams in the schematics section of Appendix A. “Schematics and Layouts”, provide details on the resistor values used for dividing the network of the input voltage. Table 2-3 provides a quick reference to resistor values in the high voltage section.
PIC18F87J72 Evaluation Board User’s Guide 2.1.3 Measurement of Low Voltages The circuit diagrams in the schematics section of Appendix A. “Schematics and Layouts”, provide details on the resistor values used for the low voltage circuit. Table 2-6 provides a quick reference to resistor values in the low voltage section.
Hardware Description 2.1.4 Measurement of Current Signals The circuit diagrams in the schematics section of Appendix A. “Schematics and Layouts”, provide details on the resistor values used for the current measurement circuit. Table 2-9 provides a quick reference to resistor values while measuring the current signals. The output of Current Transformers (CTs) can be connected to the input connector pins. TABLE 2-9: RESISTORS FOR LOW VOLTAGE MEASUREMENT Register Value (KΩ) R26 and R28 0.
PIC18F87J72 Evaluation Board User’s Guide TABLE 2-11: JUMPER SETTINGS FOR CURRENT MEASUREMENT ON CH1 CH1 Jumper Position ADC CT Primary Current (Irms-A) JP1 JP2 JP3 JP4 ADC I/P (Vrms) ADC I/P (Vpeak) Remark 0.1 Short 2-3 Open Short Open 0.00063 0.00089 0.5 Short 2-3 Open Short Open 0.00315 0.00445 Internal Gain of 2 can be used for better resolution 1 Short 2-3 Open Short Open 0.0063 0.00891 10 Short 2-3 Open Short Open 0.063 0.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Chapter 3. PIC18F87J72 Evaluation Board Features 3.1 INTRODUCTION This chapter provides a brief description on how to use the PIC18F87J72 Evaluation Board for the measurement and analysis of various signals. It also describes the process of the demo and explains various configuration changes for observing the response using the PIC18F87J72 Evaluation Board. Figure 3-1 shows the PIC18F87J72 Evaluation Board with the 9V supply connected to the input jack.
PIC18F87J72 Evaluation Board User’s Guide If the evaluation board is used in programmer mode, then the waveforms and the response can be observed on the GUI. If the evaluation board is used in debugging mode, using the MPLAB IDE, then the user can see the response on the Data Monitor and Control Interface (DMCI) window. For debugging, the Real ICE/ICD debugger and programmer is connected to the RJ11 connector.
PIC18F87J72 Evaluation Board Features As shown in Figure 3-3, the S2 key is used for changing the internal PGA gain of the first channel. The gains can be changed from 1 to 32 with each press of the key. When pressing the S2 key repeatedly, the gain configurations of the Sigma Delta ADC will sequentially change from 1, 2, 4, 8, 16, 32 and then back to 1. Display showing channel gain Press S2 to configure voltage gain FIGURE 3-3: Configuring Internal PGA Gain for voltage channel.
PIC18F87J72 Evaluation Board User’s Guide Figure 3-4 shows the function of the S3 key, which is used to change the internal gain of the second input channel. The gains can be changed from 1 to 32 with each press of the key. When pressing the S3 key repeatedly, the gain configurations of the Sigma Delta ADC will sequentially change from 1, 2, 4, 8, 16, 32 and then back to 1.
PIC18F87J72 Evaluation Board Features Figure 3-5 shows the function of the S4 key, which is used to change the bit width of the ADC conversion. Two configurations of the ADC bits are possible, either 16-bit or 24-bit. When the S4 key is pressed repeatedly, the bits toggle between 16 and 24-bit width. Display showing ADC bit width Press S4 to configure current gain FIGURE 3-5: Configuring the Number of Bits. © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board User’s Guide NOTES: DS51990A-page 22 © 2011 Microchip Technology Inc.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Chapter 4. PIC18F87J72 Evaluation Board Firmware Flowchart 4.1 INTRODUCTION This chapter provides the flowcharts describing the functions and routines implemented in the PIC18F87J72 Evaluation Board firmware.
PIC18F87J72 Evaluation Board User’s Guide START Initialize Peripherals SPI, UART Configure ADC, RTCC, CTMU Idle Charge CTMU Pads of 4 Switches SUM and Average Voltage Measure Capacitor Voltage 16 Discharge CTMU Pads of 4 Switches Calibrate for Pad Sensitivity (if required) Check for change in Capacitance SW1 Press? NO YES SW2 Press? NO SW3 Press? YES YES NO SW4 Press? YES 1 2 3 4 OSR or Read Time Switch CH0 Gain Switch CH1 Gain Switch Bits Switch High Priority Interrupt Service Routine
PIC18F87J72 Evaluation Board Firmware Flowchart 1 osr_value = 0 NO osr_value = 1 YES YES NO osr_value = 2 YES NO osr_value = 3 YES NO osr_value = 4 YES Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Set OSR 256, Write Set OSR 128, Write Set OSR 64, Write Set OSR 32, Write Read RTCC Display OSR = 256 on LCD Display OSR = 128 on LCD Display OSR = 64 on LCD Display OSR = 32 on LCD Display TIME HR:MIN
PIC18F87J72 Evaluation Board User’s Guide 2 gain1_value =0 YES NO gain1_value =1 YES NO gain1_value =2 NO YES gain1_value =3 NO gain1_value =4 YES YES NO gain1_value =5 YES Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts CH0 Gain=1, Write CH0 Gain=2, Write CH0 Gain=4, Write CH0 Gain=8, Write CH0 Gain=16, Write CH0 Gain=32, Write Display GAIN = 1 on LCD Display GAIN = 2 on L
PIC18F87J72 Evaluation Board Firmware Flowchart 3 gain2_value =0 YES NO gain2_value =1 YES NO gain2_value =2 NO YES gain2_value =3 NO gain2_value =4 YES YES NO gain2_value =5 YES Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts Disable Global Interrupts CH1 Gain=1, Write CH1 Gain=2, Write CH1 Gain=4, Write CH1 Gain=8, Write CH1 Gain=16, Write CH1 Gain=32, Write Display GAIN = 1 on LCD Display GAIN =
PIC18F87J72 Evaluation Board User’s Guide 4 bit_width = 0 NO YES bit_width = 1 YES Disable Global Interrupts Disable Global Interrupts Set Bits 16, Write Set bits 24, Write Display BITS = 16 on LCD Display BITS = 24 on LCD Enable Global Interrupts Enable Global Interrupts Idle FIGURE 4-5: DS51990A-page 28 Key Press Routine to Configure Bit Width of Channel CH0 and CH1. © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board Firmware Flowchart 5 UART TX Interrupt Flag = 1? UART RX Interrupt Flag = 1? INT0 Interrupt Flag = 1? Transmit Data from TXREG1 Receive Data from RCREG1 Measure CH0, CH1 Signals through SPI Disable UART TX Interrupt Process and Write Data to TXREG1 Store Data in RAM for DMCI or UART Enable INT0 Interrupt Disable UART RX Interrupt Disable INT0 Interrupt Enable UART TX Interrupt Enable UART RX Interrupt Return From Interrupt Return From Interrupt Return From Inter
PIC18F87J72 Evaluation Board User’s Guide NOTES: DS51990A-page 30 © 2011 Microchip Technology Inc.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Chapter 5. PIC18F87J72 Evaluation Board Lab Test Results 5.1 INTRODUCTION This chapter provides the various laboratory test results obtained when using the PIC18F87J72 Evaluation Board. This chapter also describes the use of the Data Monitor and Control Interface (DMCI) window to plot the waveforms present on Channel CH0 and CH1 of the evaluation board. Displaying waveforms on the DMCI window can only be done when the user is working in Debugging mode.
PIC18F87J72 Evaluation Board User’s Guide Figure 5-2 shows Graph 1 for CH0 and Graph 2 for CH1. The OSR for both CH0 and CH1 are chosen to be 32 and the signal amplitude applied at the input is a very low voltage sine wave signal of about 20 mV peak. The user can clearly observe the distortion of the waveform with such a low OSR value. FIGURE 5-2: DS51990A-page 32 DMCI Waveforms for 20mV Waveform with OSR = 32 on CH0 and CH1. © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board Lab Test Results Figure 5-3 shows Graph 1 for CH0 and Graph 2 for CH1. The OSR for both CH0 and CH1 are chosen to be 256 and the same signal is applied at the input with a very low voltage sine wave signal of about 20 mV peak. Here, the sine wave shape is still retained and the signal distortion is less when compared to Figure 5-2. FIGURE 5-3: DMCI Waveforms for 20mV Waveform with OSR = 256 on CH0 and CH1. © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board User’s Guide Figure 5-4 shows Graph 1 for CH0 and Graph 2 for CH1. CH0 and CH1 are both connected to the same signal of 300 mV. The internal PGA gain is chosen to be 1 for CH0 and 32 for Channel CH1. The waveform on Graph 1 is intact, while the waveform on Graph 2 is saturated at a value of 32768. This demonstrates the effect of saturation when larger gains are used.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Chapter 6. PIC18F87J72 Evaluation Board GUI 6.1 INTRODUCTION This chapter describes the Graphical User Interface used for the PIC18F87J72 Evaluation Board. Figure 6-1 indicates the various waveforms and the parameters that can be displayed on the GUI. The signals can be viewed in their real-time state in Time domain as well as in Frequency domain. UART is used for communication between the GUI and the microcontroller. The baud rate used for communication is 38400.
PIC18F87J72 Evaluation Board User’s Guide NOTES: DS51990A-page 36 © 2011 Microchip Technology Inc.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Appendix A. Schematics and Layouts A.1 INTRODUCTION This appendix contains the following schematics and layouts of the PIC18F87J72 Evaluation Board: • • • • • • • • • • • Board – Schematic 1 Board – Schematic 2 Board – Schematic 3 Board – Schematic 4 Board – PCB Front Page Board – PCB Top Silk Board – PCB Top Layer Board – PCB Bottom Layer Board – PCB Bottom Silk Board – PCB L1 Ground Board – PCB L2 VDD © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board User’s Guide BOARD – SCHEMATIC 1 A.2 DS51990A-page 38 © 2011 Microchip Technology Inc.
Schematics and Layouts BOARD – SCHEMATIC 2 RG1* is Unused Pin A.3 © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board User’s Guide BOARD – SCHEMATIC 3 A.4 DS51990A-page 40 © 2011 Microchip Technology Inc.
Schematics and Layouts BOARD – SCHEMATIC 4 A.5 © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board User’s Guide A.6 BOARD – PCB FRONT PAGE PICTail DS51990A-page 42 TM © 2011 Microchip Technology Inc.
Schematics and Layouts A.7 BOARD – PCB TOP SILK TM PICTail © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board User’s Guide A.8 BOARD – PCB TOP LAYER DS51990A-page 44 © 2011 Microchip Technology Inc.
Schematics and Layouts A.9 BOARD – PCB BOTTOM LAYER © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board User’s Guide A.10 BOARD – PCB BOTTOM SILK DS51990A-page 46 © 2011 Microchip Technology Inc.
Schematics and Layouts A.11 BOARD – PCB L1 GROUND © 2011 Microchip Technology Inc.
PIC18F87J72 Evaluation Board User’s Guide A.12 BOARD – PCB L2 VDD DS51990A-page 48 © 2011 Microchip Technology Inc.
PIC18F87J72 EVALUATION BOARD USER’S GUIDE Appendix B. Bill of Materials (BOM) This chapter provides the Bill of Materials for all the components and devices used on the PIC18F87J72 Evaluation Board. TABLE B-1: Qty BILL OF MATERIALS (BOM) Reference Description Manufacturer Part Number 1 BAT1 BATTERY IND ALKALINE 9 VOLT Energizer EN22 1 BAT1 CONN PC VERT 9V SNAP-ON Keystone 96B 4 C1, C3, C5, CAP 47UF 16V ELECT FP SMD C7 Panasonic® 16 C2, C4, C6, CAP CER .
Bill of Materials (BOM) TABLE B-1: Qty BILL OF MATERIALS (BOM) (CONTINUED) Reference Description Manufacturer Part Number 2 JP1, JP8 CONN HEADER 3POS .100” STR TIN Molex 90120-0123 6 JP2, JP3, JP4, JP5, JP6, JP7 CONN HEADER 2POS .100 VERT TIN Molex/Waldom Electronics Corp.
NOTES: © 2011 Microchip Technology Inc.
Worldwide Sales and Service AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://www.microchip.com/ support Web Address: www.microchip.