/* * File: newmain.c * Author: A14942 * * Created on 2019? 4? 15? (?), ?? 9:33 */ // PIC16F1503 Configuration Bit Settings // 'C' source line config statements // PIC16F1503 Configuration Bit Settings // 'C' source line config statements // PIC16F1503 Configuration Bit Settings // 'C' source line config statements // PIC16F1503 Configuration Bit Settings // 'C' source line config statements // CONFIG1 #pragma config FOSC = INTOSC // Oscillator Selection Bits (INTOSC oscillator: I/O function on CLKIN pin) #pragma config WDTE = OFF // Watchdog Timer Enable (WDT enabled) #pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled) #pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is MCLR) #pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) #pragma config BOREN = OFF // Brown-out Reset Enable (Brown-out Reset disabled) #pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin) // CONFIG2 #pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off) #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset) #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.) #pragma config LPBOR = OFF // Low-Power Brown Out Reset (Low-Power BOR is disabled) #pragma config LVP = OFF // Low-Voltage Programming Enable (High-voltage on MCLR/VPP must be used for programming) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include #define _XTAL_FREQ 500000 void main(void) { TRISA = 0x00; LATA1 = 1; __delay_ms(200); LATA1 = 0; __delay_ms(200); LATA1 = 1; __delay_ms(200); LATA1 = 0; __delay_ms(200); while(1){ LATA1 ^= 1; __delay_ms(1); CLRWDT(); } return; } |
'MCU Basic' 카테고리의 다른 글
Sleep power consumption (PIC16F1503 vs PIC16F15323 vs PIC12F1501) (0) | 2019.04.15 |
---|---|
Absolute Maximum Ratings의 의미 (0) | 2019.01.28 |
Windowed WDT란? (WWDT) (1) | 2019.01.21 |
EEPROM대신 사용할 수 있는 HEF ( High Endurance Flash) (0) | 2019.01.21 |
300Hz Sine waveform using DAC on microcontroller (0) | 2019.01.18 |