Please share your suggestions, comments, and criticisms in the box below. Every message is read and receives a response. Thank you for taking time to improve the tool!
In this project, a prototype for Heart Rate (ECG) monitoring system is designed using the Xpress development platform. A Mikroelektronika Heart Rate Click is used with the Xpress Evaluation board for this project.
The MPLAB Xpress Evaluation board has Mikroelektronika Click socket. Using MPLAB Xpress IDE and MPLAB Code Configurator (MCC) the Xpress evaluation board will be programmed to communicate with the Heart Rate Click and to send the heart rate data to the PC.
To follow along with these steps, MPLAB® Xpress should be open and logging in to the Xpress IDE is recommended to save the project. The setup is described in the steps of this training module. You should see a screen similar to the one shown below when opening the IDE.
The MPLAB Xpress Development board should be connected to an available USB port on the host computer through a USB cable to the micro B connector on the board. Drivers should install successfully the first time the board is connected and may take a minute or so depending on the computer speed. The heart rate click is also connected to the MikroE socket on the Xpress board. The connection is shown in the picture below.
Create a new project in MPLAB® Xpress for PIC16F188555 using the MPLAB Xpress Development Board. Instructions are below if this is your first project. If you already know how to create a project and launch MCC, you can jump to step 5. Here is a video showing how to create a project in MPLAB® Xpress.
Launch the New Project Wizard using one of the following methods: From the Toolbar: Click on the New Project icon, or From the Menu: Select File ► New Project
The project wizard will walk you through the process and prompt you for all the required information. Your selections may be changed after the project has been created by modifying the project's properties.
2. Choose Project
a. Choose Microchip Embedded from the Categories column (center).
b. Choose Standalone Project from the Projects column (right).
c. Click the Next > button.
3. Select Device
a. Choose the device family from the Family drop-down box.
b. Choose your device's part number from the Device drop down box. You may also type in the part number directly, and the list will adjust to the characters you enter.
Or, start typing the part number in the device box using keypad and it will begin search for the matching part number; select the right one from the list
4. Select Project Name and Folder
Choose a Project Name. This will be your project's name that the IDE will create.
Note: The name cannot have any empty spaces!
Open the MPLAB® Code Configurator (MCC) using the MCC icon or under the Tools>Embedded>MPLAB Xpress Code Configurator menu of MPLAB Xpress.
A window will appear showing three steps. If you need the latest version of Java you can click on step one, otherwise click on the step two button to open the MPLAB® Xpress Code Configurator.
A file will automatically download in your browser similar to the picture shown. Click on that file to open it. This is a java application that will launch the MCC.
The process can take several seconds to a minute depending on your internet connection speed. Several windows may appear asking if you want to run the program. Also for if you are running the MCC tool for the first time it will ask you for a token which you will find in the pop up box in the Xpress IDE, you can copy and paste it to the token box. When the process is complete you will see a new screen appear, separate from the MPLAB Xpress IDE, that is the MCC control screen. In this screen you can select peripherals for your project, system setup for oscillator and other configuration settings, input and output selections for your device. When all of these are completed you can generate project code including a main.c file by clicking on the Generate button near the center top of the screen. All these generated files will be included in your MPLAB Xpress project.
When the System Module selection is highlighted in the Project Resources area the System Module settings will appear in the center of the MCC screen.
For this project we are leaving everything default which is as follows:
a. Oscillator Select: HFINTOSC (1MHz)
b. HF Internal Clock: 4MHz
c. Clock Divider: 4
WDT Disabled, SWDTEN is ignored
a. Download the latest version of the Foundation services library by right click>mark for load>load selected libraries from the versions section of MCC
b. Repeat the previous process to download the latest version of Mikroelektronika click library from the list as well
a. Add the Heartrate click to the project by double clicking the heartrate module under Device Resources>Mikro-E-Clicks>Sensors>Heartrate b. Configure the Heartrate Module as follows: Mode: Heart-Rate(HR) Only, Sample Rate: 100sps, Pulse Width: 1600us, IR LED Current: 50mA, RED LED Current: 50mA
c. Configure the I2C (MSSP1) pins for communicating with the click board from the pin and port section of MCC. For SDA1 use RC3 and SCL1 use RC4; click on the pin and make sure a lock symbol appears (As SDA and SCL cannot be the same pin, from default selection move the SDA to RC2 first and select SCL to RC4. Then move SDA to RC3)
To use the generated example by MCC timer0 interrupt is needed. Add TMR0 from the device resources under Timer. Configure TMR0 as follows: Clock Prescaler = 1:1, Postscaler = 1:1, Timer Mode = 16-bit, Clock Source = HFINTOSC, Requested Period = 1 ms and check the enable timer interrupt box
a. To plot the result on screen heart rate sensor data is transferred over EUSART/USB. Add EUSART module from the device resources window to the project (Use the EUSART [PIC10/PIC12…..] module). Configure the EUSART module as follows: check Enable Transmit box, Baud Rate = 9600, transmission and reception = 8 bits and check the Redirect STDIO to USART box
b. Configure the EUSART Pin as follows: TX = RC0 and RX = RC1
Click the Generate button in MCC to create the appropriate header and source files for this configuration.
Upon successful code generation the “Generation Completed” notification should appear. Select “OK” to close the window.
New MCC Generated header and source files should now be present in the Project window of the MPLAB Xpress IDE including a new main.c source file
Now open main.c by simply clicking on it and make the following changes:
Compile and download the project .hex file by clicking on the Make and Program Device button at the top of the MPLAB Xpress IDE.
Program the MPLAB Xpress board by dragging the project .hex file from the downloads section of the browser and dropping the file on to the Xpress drive.
The Programmer LED on the Xpress board should quickly flash from green to red and then back to green indicating that the .hex file was successfully programmed to the PIC16F18855.
To plot the EKG data download the latest version of the plotting software from github.com. Go to github.com and search for Prototyping with sensors. Download the latest release and install it in your computer. It is available for Windows (.exe), MAC (.dmg) and Linux (.tar.gz).
Now place your finger on the sensor on a level surface and try not to have any movement. If everything configured properly you should see a plot similar to this in the plotting software:
This project can be the basis for prototyping easily and quickly with Mikroelektronika clicks and Microchip development boards. Similar steps can be followed to configure many other click boards for a proof of concept to port the project over to an actual product.
MPLAB Xpress IDE shall mean the online integrated development environment (hereinafter “MPLAB Xpress”) operated by or on behalf of Microchip Technology Incorporated (hereinafter "Microchip") for your use, whether as a guest or a registered user. Microchip is a Delaware corporation with its principal office at 2355 W. Chandler Boulevard, Chandler, AZ 85224.
Access to MPLAB Xpress is permitted on a temporary basis, and Microchip reserves the right to withdraw or amend the information provided on MPLAB Xpress without notice. Microchip will not be liable if for any reason MPLAB Xpress is unavailable at any time or for any period. From time to time, Microchip may restrict access to some or all of MPLAB Xpress.
Material on MPLAB Xpress may be out of date or include omissions, inaccuracies or other errors at any given time, and Microchip is under no obligation to update such material. Commentary and other materials posted on MPLAB Xpress are not intended to amount to advice on which reliance should be placed. Microchip disclaims all liability and responsibility arising from any reliance placed on such materials by any user of MPLAB Xpress, or by anyone who may be informed of any of its contents. Microchip owns or has the rights to the materials and information it posts on MPBLAB Xpress, but does not and cannot warrant or guaranty any information or materials posted by others.
EXCEPT WHERE EXPRESSLY PROVIDED OTHERWISE IN AN AGREEMENT BETWEEN YOU AND MICROCHIP, ALL INFORMATION PROVIDED DIRECTLY ON MPLAB XPRESS OR INDIRECTLY THROUGH MPLAB XPRESS BY HYPERTEXT LINK OR OTHERWISE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROCHIP HEREBY DISCLAIMS ALL WARRANTIES WITH RESPECT TO THIS INFORMATION, WHETHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROCHIP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM YOUR ACCESS TO, USE OF, OR RELIANCE UPON INFORMATION OBTAINED FROM OR THROUGH MPLAB XPRESS. MICROCHIP RESERVES THE RIGHT TO MAKE CHANGES, UPDATES OR CORRECTIONS TO THE INFORMATION ON MPLAB XPRESS AT ANY TIME WITHOUT NOTICE.
Contracts for the supply of goods, services or information formed through the use of the MPLAB Xpress site or as a result of visits made by you to the MPLAB Xpress site are governed by these terms and conditions.
MPLAB Xpress may contain links to other sites and resources provided by third parties. Any such links are provided for your information only. Microchip has no control over the contents of those sites or resources, and accepts no responsibility for them or for any loss or damage that may arise from your use of them.
How is Customer Information Obtained by Microchip and How is it Used?
We receive and store information you give us, anonymously. Most of the information you give us is collected when you buy products on-line, request literature/ information, participate in a contest, fill out a questionnaire/survey, participate in an on-line discussion, or complete your Customer Profile. You may give us information such as your name, address, phone numbers, e-mail addresses, financial information, employment information, application information, ideas for new projects or applications, and your buying interests. The information that you provide us is used to respond to your requests, notify you of products being shipped to you, customize your interactions with us, improve our offerings, provide materials or offers to you, allow you to participate in contests, and communicate with you. It is your choice whether or not to provide us with certain information. However, you may be unable to take advantage of many of our offers and features if we do not receive your customer information.
We also receive and store certain types of information through use of “cookies.” Some examples of information gathered this way are the Internet Protocol (IP) address used to connect your computer to the Internet, log-in, e-mail address, computer and connection information such as browser type and version, operating system, platform, and the full Uniform Resource Locator (URL) used to, through, and from access of MPLAB Xpress. We use the information gathered by “cookies” to manage and customize your on-line experience and to improve our services.
You may also submit technical information to Microchip such as designs, ideas or data, that you transmit to or post on MPLAB Xpress example section (a "Submission") for purposes not limited to community development participation. By posting a Submission, you understand that you give Microchip and the community a nonexclusive, royalty-free, perpetual, irrevocable, sublicensable right to disseminate, display, use, modify, copy, adapt, and translate the Submission for any purpose whatsoever, whether commercial or noncommercial, throughout the world in any media. The Submission is not confidential or proprietary. Providing the Submission, grants the right to use the name you submit in connection with your Submission. You represent and warrant in making the Submission that you own or control all rights to the Submission, and that use of your Submission will not cause injury to any person or entity, including Microchip. You will indemnify Microchip for all claims resulting from your Submission.
How can I manage the information Microchip has about me?
You can always choose not to give Microchip information. However, certain information is necessary in order for you to take advantage of MPLAB Xpress, any change notifications, literature, updates, etc.
If you want to add/update your information or preferences, please modify your MPLAB Xpress account profile. When you update your information, we may keep a copy of your earlier information for our records.
You can avoid certain "cookies" by indicating in your account profile that you do not want us to remember you. Your browser may also have options to prevent acceptance of new “cookies.” There are also utilities available allowing you to visit MPLAB Xpress anonymously. Unfortunately, certain features and offerings available through MPLAB XPress may not be available to anonymous users.
Who does Microchip share Customer Information With?
Customer information is important for Microchip to be able to offer products and services to you. We are not in the business of selling customer information to others. We do share customer information with our subsidiaries and with others as described below. Such third parties may be based in the United States, Europe or Thailand. We are not responsible for the privacy practices of third parties to whom your information may be transferred. If you do not wish us to share your information as described below, you may opt out by not supplying information to us when entering information into your account profile, or by not placing orders through MPLAB Xpress.
Agents: We use other companies and persons to perform tasks on our behalf. Examples are not limited to web hosting of MPLAB Xpress, delivering packages, processing credit card payments, checking for export compliance, and providing customer service. They have access to customer information to perform their jobs, but may not use it for other purposes. Microchip may share your customer information with third parties and receive information from credit bureaus and other companies to help prevent and detect fraud, and to offer credit or financial services to some customers. Microchip cannot guaranty the security of such agent services provided on its behalf. As such, Microchip makes no representations or warranties regarding any third party services and has no responsibility or liability whatsoever for any such third party services and is not responsible for the content or privacy practices of such third parties
Third Parties: Except for information transmitted to Microchip through the on-line support system at http://support.microchip.com, any other Submission to Microchip such as designs, ideas or data that you transmit to or post on MPLAB Xpress by any means for any purpose including but not limited to contest participation is considered and treated by Microchip as nonconfidential and nonproprietary.
Conformance with the Law: We release account and other customer information when we believe it is appropriate to comply with the laws of Arizona.
Protection of Microchip and Others: Microchip will release customer information necessary to enforce or apply our MPLAB Xpress IDE Terms and Conditions, and other agreements. Microchip will, at its discretion, release customer information necessary to protect the rights, property and safety of Microchip or others in accordance with the laws of Arizona.
We use 256-bit encryption to secure the financial information you enter. Only the last five digits of your credit card number are listed in your Order Acknowledgement. However, your entire credit card number is transmitted to your credit card company during order processing, and your identifying and credit information is transmitted to companies that process your credit card transactions and review them for export control violations.
Law and Jurisdiction
If you have any concern about our treatment of your customer information, please send us an e-mail at email@example.com.