Introduction to using mplab and hi tide
This presentation is the property of its rightful owner.
Sponsored Links
1 / 11

Introduction to Using MPLAB and Hi-tide PowerPoint PPT Presentation


  • 56 Views
  • Uploaded on
  • Presentation posted in: General

Introduction to Using MPLAB and Hi-tide. Group #9 JoseAlex MikeRoberto Goto http://www.alexhan.net/senior.html and print the file. Purpose of Programs. Cgywin is to emulate Linux to run the other programs

Download Presentation

Introduction to Using MPLAB and Hi-tide

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Introduction to using mplab and hi tide

Introduction to Using MPLAB and Hi-tide

Group #9

JoseAlex

MikeRoberto

Goto http://www.alexhan.net/senior.html and print the file


Purpose of programs

Purpose of Programs

  • Cgywin is to emulate Linux to run the other programs

  • Picc lite and Hi-tide are the environment to write your code for programming the microcontroller and converts to Hex

  • MPLAB is software that allows the codes to be transferred to the microcontroller


Program code

Program Code

  • Motor Control

  • IR Sensor

  • Key Debouncer


Led on

LED On

#include "init.h"// included by C-Wiz

#include <htc.h>

void

main(void)

{

init();// Function call inserted by C-Wiz

while (1){

RA0=1;

//TODO Auto-generated main function

}

}


Led flashing 5 sec

LED flashing 5 sec

int i,k;

void

main(void)

{

init();// Function call inserted by C-Wiz

while (1){

k=0;

while (k<1000){

i=0;

k++;

while (i<1500){

i++;}

}

RA0=RA0^1;

}

}


Led flashing w interrupts

LED Flashing w / Interrupts

// Interrupt service routines

#include <htc.h>

externint k;

void interrupt my_isr(void){

/***** Timer 1 Code *****/

if((TMR1IE)&&(TMR1IF)){

if(k>50)

{

k=0;

RA0=RA0^1;

}

else

k++;

TMR1IF=0;// clear event flag

}

}


Conflict with loop

Conflict With Loop

5 Second LED flip-flop

And Key Debouncer running in main.c


Key debouncer

Key Debouncer

i = 0; // Wait 20 ms for Button Down

while (i < Twentyms)

if (1 == RA3) // Button Up / Start over

i = 0;

else // Button Down /Increment Count

i = i + 1;


Motor control

Motor Control

main(void)

{

init();// Function call inserted by C-Wiz

while (1){

RA0=RA0^1;

i=0;

while(i<10)

{

i++;

k=0;

while(k<3000)

{k++;}}

//CCPR1L= 0b01111111;

A=A+1;

CCPR2L= A;

if(CCPR2L==0XFF)

CCPR1L=~CCPR1L;


Ir sensor

IR Sensor

#include "init.h"// included by C-Wiz

#include <htc.h>

void

main(void)

{

init();// Function call inserted by C-Wiz

while (1){

if(RB2==1)

RA0=0;

else

RA0=1;

//TODO Auto-generated main function

}

}


The end

The End

Thanks Ya’ll

Email or get in touch with us for more information or questions.


  • Login