Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

Gpio not turning high in led blink program
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Gpio not turning high in led blink program

by sreejith1arikath on Wed Jan 19, 2022 7:54 am

Hi all iam new to pic12f675.trying to implement led blink program
But Gpio not turning high
kindly review the code below and please guide

#pragma config FOSC = INTRCIO // Oscillator Selection bits (INTOSC oscillator: I/O function on GP4/OSC2/CLKOUT pin, I/O function on GP5/OSC1/CLKIN)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF // Power-Up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = ON // GP3/MCLR pin function select (GP3/MCLR pin function is digital I/O, MCLR internally tied to VDD)
#pragma config BOREN = OFF // Brown-out Detect Enable bit (BOD disabled)
#pragma config CP = OFF // Code Protection bit (Program Memory code protection is disabled)
#pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)

#include <xc.h>
#define _XTAL_FREQ 4000000
void main(void) {
TRISIO = 0x00;//set led as o/p
ANSEL = 0x00;//for setting digital i/o
CMCON = 0x07;
VRCON = 0x00;
ADCON0 = 0x00;
GPIO = 0;
// INTCON.PIE=0;
while(1)
{

GP2 = 1;// setting port as 1
__delay_ms(2000);
GP2 = 1;// setting port as 1
__delay_ms(2000);

}

return;
}

sreejith1arikath
 
Posts: 1
Joined: Wed Jan 19, 2022 7:51 am

Re: Gpio not turning high in led blink program

by adafruit_support_mike on Wed Jan 19, 2022 9:19 pm

I'm afraid we aren't too familiar with the PIC family of microcontrollers. Maybe someone from the community will have more information.

adafruit_support_mike
 
Posts: 64502
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.