MPLAB Xpress Evaluation Board DC Motor

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

2016

Interfacing DC Motor
With
MPLAB Xpress Evaluation Board

Author: A.Siva
Reviewers:

Introduction:
MPLAB Xpress IDE cost free development platform. Its cloud Based IDE available from
microchip supporting PIC-based microcontrollers. The platform is comprised of code
editor, build automation tools, debugger, code configurator. MPLAB Xpress IDE is an endto-end solution enabling engineers to develop their applications from initial evaluation to
final production.
Component Requirement
Hardware:
o MPLAB Xpress Evaluation Tool
o Micro B cable
o Dc motor
o L293D IC
o Jumper wires
o Power supply Breakout for(5v motor suppply)
Software:
o MPLAB Xpress IDE

Step 1: Open your Browser and go to following link


https://mplabxpress.microchip.com/mplabcloud/ide

Figure 1 MPLAB Xpress IDE main window

Step 2: start creating our new project. Go to File >> New Project. Select microchip
embedded as well as standalone project then click next

Figure 2 Open new project

Step 3: Select device pic16f18855, and click next .

Figure 3 select Device

Step 4: then give project name and click finish.

Figure 4 give project name

Step 5: Now choose MPLAB Xpress code configurator if its not present in your Device
please Download and install

Figure 5 Select MPLAB Xpress code configurator

Step 6: Now we can see our MPLAB Xpress configuration window and select system
module in MPLAB Xpress configuration window .

Figure 6 configuration window

Step 8: select RC3,RC4 pin and select pin module in MPLAB Xpress configuration window
and deselect Analog in pin module set as out put

Figure 7 pin configuration set

SOURCE CODE:
#include "mcc_generated_files/mcc.h"
void main(void)
{
SYSTEM_Initialize();

// initialize the device

int i,n=10000;
RC3=0; RC4=0;
while (1)

// continues loop

{
RC3=0; //input 1
RC4=0; //input 2
for(i=0;i<=n*2;i++);

//delay loop change state

RC3=1; //input 1
RC4=0; //input 2
for(i=0;i<=n*2;i++);

//delay loop change state

RC3=1; //input 1
RC4=1; //input 2
for(i=0;i<=n*2;i++);

//delay loop change state

RC3=0; //input 1
RC4=1; //input 2
for(i=0;i<=n*2;i++);
}
}

//delay loop change state

Step 10: Go to your MPLAP Xpress IDE Erase all existing code and copy above code past
there then make clean and build for Export. If you done this go to download you can see
hex file for your project.

Figure 10 Build the project

Step 11: Now, if all goes well connect the Micro B cable to PIC16F18855 (MPLAB Xpress
demonstration board) and connect it to your computer. If you done you can see your
devise. And copy that Hex file to your device. And make hardware connection.

OUTPUT:

Figure 12 output

For more information please visit: www.tenettech.com


For technical query please send an e-mail: info@tenettech.com

You might also like