Comments on: Using Interrupt with PIC Microcontroller https://electrosome.com/interrupt-pic-microcontroller/ You Inspire.....We Create..... Fri, 08 Feb 2019 13:08:47 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: neba stanly https://electrosome.com/interrupt-pic-microcontroller/#comments/7252 Fri, 08 Feb 2019 13:08:47 +0000 https://electrosome.com/?p=2824#comment-7252 hi sir,
i need a cod for pic16f877a that receive a range of analog signal, convert to digital and display on the screen, and lastly send an sms to a phone number if the value exceed 100.
thanks

]]>
By: Nigel Thrower https://electrosome.com/interrupt-pic-microcontroller/#comments/7108 Sat, 09 Jun 2018 12:06:03 +0000 https://electrosome.com/?p=2824#comment-7108 In reply to Zoltan Lánczky.

Been tearing my hair out. So thankful for this post.

]]>
By: SD Pro Staffs https://electrosome.com/interrupt-pic-microcontroller/#comments/6844 Thu, 10 Aug 2017 06:59:00 +0000 https://electrosome.com/?p=2824#comment-6844 In reply to Kasun Wickramarachchi.

#include
__CONFIG(0x3d72);//nsk pic board used this command

void timer() //timer function
{

for(int i=0;i<200;i++) //1 sec calculation loop
{
TMR0 = 0x9E;
while (TMR0IF == 0); //timer flag
TMR0IF=0;

}
}

void main(void)
{

TRISD = 0x00;
PORTD = 0x00;
//timer

T0CS =0;
PSA =0;
PS2 =1;
PS1 =1;
PS0 =1;

//interrupts

GIE=1; //global interrupt enable
INTF=0; //clear interrupt flag bit
INTEDG=1; //configure detection of interrupt on rising edge

while(1)
{
RD0=1;

if (INTF==1)
{
RD1 = 1;
timer();
RD1 = 0;
timer();
INTF=0;
}
timer() ;
RD0 = 0;
timer() ;

}
}

]]>
By: Sanjiv Pandit https://electrosome.com/interrupt-pic-microcontroller/#comments/6824 Thu, 20 Jul 2017 09:44:00 +0000 https://electrosome.com/?p=2824#comment-6824 In reply to Ligo George.

Ligo George Mod PICMICRO • 3 years ago
Try doing like this :
unsigned int cnt;
void main()
{
cnt = 0;


}
void interrupt()
{

..
cnt++;

}

I did this, but my count is getting incremented by 2.

]]>
By: Kasun Wickramarachchi https://electrosome.com/interrupt-pic-microcontroller/#comments/6786 Sun, 28 May 2017 13:46:00 +0000 https://electrosome.com/?p=2824#comment-6786 hi , i am an electronic engineering student , and i was trying to learn how we can use interrupts , while that period i tried a code , but unfortunately effort unsucceed and by searching through the internet could to find your code, and i copied down it and applied for my proteus simulation also , the same result could to see , interrupt doesn’t response…This is the code which i am trying to success on proteus simulation.

void main() {

TRISD=0b11110000; //TRISD AS OUTPUT
TRISB=0b00000011; //TRISB AS INPUT
//OPTION_REG.F7=0;//ENABLE PULLUPS
INTCON.GIE=1; //bit7 of INTCON ENABLE
INTCON.INTE=1; //BIT4 OF INTCON ENABLE (RBO)
OPTION_REG.INTEDG=1; // BIT6 OF OPTION REGISTER ENABLE
//OPTION_REG=0b00111111;
//INTCON=0b10010000;

while(1){

if(PORTB.F1==1){

PORTD.F0=1;
Delay_ms(100);
PORTD.F0=0;
Delay_ms(100);

PORTD.F1=1;
Delay_ms(100);
PORTD.F1=0;
Delay_ms(100);

PORTD.F2=1;
Delay_ms(100);
PORTD.F2=0;
Delay_ms(100);

PORTD.F3=1;
Delay_ms(100);
PORTD.F3=0;
Delay_ms(100);

PORTD.F2=1;
Delay_ms(100);
PORTD.F2=0;
Delay_ms(100);

PORTD.F1=1;
Delay_ms(100);
PORTD.F1=0;
Delay_ms(100);

PORTD.F0=1;
Delay_ms(100);
PORTD.F0=0;
Delay_ms(100);

}

else {

PORTD=0b00000000;
}
}
}
void interrupt(){ //ISR

INTCON.INTF=0;//CLEAR INTERRUPT FLAG
PORTD=0b00000000;
Delay_ms(1000);
}

]]>
By: Ligo George https://electrosome.com/interrupt-pic-microcontroller/#comments/6274 Sat, 27 Aug 2016 07:51:00 +0000 https://electrosome.com/?p=2824#comment-6274 In reply to seshu.

PORTB on change interrupt is used in the following project :
https://electrosome.com/hc-sr04-ultrasonic-sensor-pic/

]]>
By: seshu https://electrosome.com/interrupt-pic-microcontroller/#comments/6196 Mon, 25 Jul 2016 13:32:00 +0000 https://electrosome.com/?p=2824#comment-6196 how to use PORTB Change Interrupts in the controller

]]>
By: Ligo George https://electrosome.com/interrupt-pic-microcontroller/#comments/3891 Tue, 27 Jan 2015 11:59:00 +0000 https://electrosome.com/?p=2824#comment-3891 In reply to Cj92.

It is already explained in the article.
The interrupt will be triggered during rising edge (LOW to HIGH transition) of RB0/INT interrupt pin..

]]>
By: Cj92 https://electrosome.com/interrupt-pic-microcontroller/#comments/3879 Sun, 25 Jan 2015 16:37:00 +0000 https://electrosome.com/?p=2824#comment-3879 Hi, i’m new to PIC programming. Can’t find a clue to what this line is for in the article! Can you explain it?
“OPTION_REG.INTEDG = 1; // Set Rising Edge Trigger for INT”

]]>
By: Ligo George https://electrosome.com/interrupt-pic-microcontroller/#comments/3841 Wed, 21 Jan 2015 05:32:00 +0000 https://electrosome.com/?p=2824#comment-3841 In reply to taha.

I will try to post a tutorial.

]]>