Skip to content

Instantly share code, notes, and snippets.

@Richardn2002
Created October 5, 2023 23:26
Show Gist options
  • Save Richardn2002/6bf7219673065921fb7f9e6466d075e1 to your computer and use it in GitHub Desktop.
Save Richardn2002/6bf7219673065921fb7f9e6466d075e1 to your computer and use it in GitHub Desktop.
Blinky on GP4 for PIC12F529T39A
#pragma config OSC = INTRC
#pragma config WDT = OFF
#pragma config PARITY = SET
#pragma config MCLRE = ON
#pragma config IOSCFS = 8MHz
#pragma config CPDF = OFF
#pragma config CP = DISABLE
#include <xc.h>
#define _XTAL_FREQ 8000000
void main(void) {
asm("MOVLW 0b11101111");
asm("TRIS 6");
while(1) {
PORTBbits.RB4 = 1;
__delay_ms(10);
PORTBbits.RB4 = 0;
__delay_ms(10);
}
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment