srikanthind
New Member
hi, could find if there is intialisation wrong below the program, i tried to turn the GPIO4 LED on, but its not working on hardware.. its working while simulating.. am using PIC 12f675 microcontroller..
GPIO3 connected as a input, whenever it is pressed , interrrupt would occur,,
Code:
#define TRISIO_DEFAULT 0b11101101
#define GPIO_DEFAULT 0b00011001
void main(void)
{
ANSEL = 0b00000000;
OPTION = 0b10000001; // Configure the time (bit5=0, bit3=0, bits 2-0=100 - prescaler=32); Thus, overflow occurs each 8.192ms
CMCON = 0b00000000;
GPIO=0;
GIE = 1;
T0IE = 1;
GPIE = 1;
IOCB3 = 1;
T0IF = 0;
GPIF = 0;
TRISIO = TRISIO_DEFAULT; //
GPIO = GPIO_DEFAULT;
while(1){}
}
GPIO3 connected as a input, whenever it is pressed , interrrupt would occur,,