Currently I have been revising my skills in programming PIC Micros. I have been simulating my projects first in Proteus and then implemening them using a PIC18F4620..
I am writing a very simple problem whereby I intend to use the INTO interrupt to switch off and initially on LED in Port D pin 0.
here is my C code;
and here is my Proteus schematics
Proteus schematics are also attached
When I use a pushbutton to enable the INTO interrupt nothing happens in the diode and therefore the interrupt is not functioning
does anybody have any idea??
Moderators note: Please use code tags for pieces of code.
I am writing a very simple problem whereby I intend to use the INTO interrupt to switch off and initially on LED in Port D pin 0.
here is my C code;
Code:
========================================
# include<htc.h>
# define _XTAL_FREQ 8000000
// Define the interrupt function
void interrupt Flash_LED()
{
if(INT0F)
{
RD0 = 0;
INT0F = 0;
}
}
void main()
{
IPEN = 0; // disable interrupt priority
GIE = 1;// Global interrut enable pit
INT0F = 0;// rerset interrupt enable pit
INT0IE = 1;// INTO interrupt enable pit
//RBPU = 1; // disable pullups in port B
TRISD0 = 0; // Configure pin 0 of the D port as an output pin
TRISB0 = 1; // Configure pin 0 of the B port as an input pin
RD0 = 1; // LED initially in on state
while(1);
}
========================
Proteus schematics are also attached
When I use a pushbutton to enable the INTO interrupt nothing happens in the diode and therefore the interrupt is not functioning
does anybody have any idea??
Moderators note: Please use code tags for pieces of code.
Last edited by a moderator: