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)
TRISIO, ANSEL and CMCON are all correct. I find no need for VRCON or ADCON0 as those are turned off.
Is GP2 a valid identifier, or should it be GPIO.2 ?
TRISIO, ANSEL and CMCON are all correct. I find no need for VRCON or ADCON0 as those are turned off.
Is GP2 a valid identifier, or should it be GPIO.2 ?
I noticed that as well, but I presumed he'd changed it because he can't get GP2 to go high?, and this was a desperate attempt to try and make it so - personally I'd have simply commented out all but the first of the four lines.
This is worded wrong MCLRE = ON means you need a resistor to 5v circ 10k.. MCLRE = OFF means tied internally
datasheet said:
bit 5 MCLRE: GP3/MCLR Pin Function Select bit(5)
1 = GP3/MCLR pin function is MCLR
0 = GP3/MCLR pin function is digital I/O, MCLR internally tied to VDD