|
| 1 | +/******************************************************************************* |
| 2 | + Generated MPLAB® Code Configurator File |
| 3 | +
|
| 4 | + Company: |
| 5 | + Microchip Technology Inc. |
| 6 | +
|
| 7 | + File Name: |
| 8 | + code_manager.c |
| 9 | +
|
| 10 | + Summary: |
| 11 | + This is the MPLAB¬Æ Code Configurator file generated using MPLAB® Code Configurator |
| 12 | +
|
| 13 | + Description: |
| 14 | + This header file provides implementations for driver APIs for all modules selected in the GUI. |
| 15 | + Generation Information : |
| 16 | + Product Revision : MPLAB® Code Configurator - v1.0 |
| 17 | + Device : PIC16F1825 |
| 18 | + Version : 1.1 |
| 19 | + The generated drivers are tested against the following: |
| 20 | + Compiler : XC8 v1.21 |
| 21 | + MPLAB : MPLAB X 1.90 |
| 22 | +*******************************************************************************/ |
| 23 | + |
| 24 | +/******************************************************************************* |
| 25 | +Copyright (c) 2013 released Microchip Technology Inc. All rights reserved. |
| 26 | +
|
| 27 | +Microchip licenses to you the right to use, modify, copy and distribute |
| 28 | +Software only when embedded on a Microchip microcontroller or digital signal |
| 29 | +controller that is integrated into your product or third party product |
| 30 | +(pursuant to the sublicense terms in the accompanying license agreement). |
| 31 | +
|
| 32 | +You should refer to the license agreement accompanying this Software for |
| 33 | +additional information regarding your rights and obligations. |
| 34 | +
|
| 35 | +SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, |
| 36 | +EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF |
| 37 | +MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. |
| 38 | +IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER |
| 39 | +CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR |
| 40 | +OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES |
| 41 | +INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR |
| 42 | +CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF |
| 43 | +SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES |
| 44 | +(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. |
| 45 | +*******************************************************************************/ |
| 46 | + |
| 47 | + |
| 48 | +#include "mcc.h" |
| 49 | + |
| 50 | +// Configuration bits: selected in the GUI |
| 51 | +#pragma config FOSC = INTOSC // Oscillator Selection->INTOSC oscillator: I/O function on CLKIN pin |
| 52 | +#pragma config WDTE = OFF // Watchdog Timer Enable->WDT disabled |
| 53 | +#pragma config PWRTE = OFF // Power-up Timer Enable->PWRT disabled |
| 54 | +#pragma config MCLRE = ON // MCLR Pin Function Select->MCLR/VPP pin function is MCLR |
| 55 | +#pragma config CP = OFF // Flash Program Memory Code Protection->Program memory code protection is disabled |
| 56 | +#pragma config CPD = OFF // Data Memory Code Protection->Data memory code protection is disabled |
| 57 | +#pragma config BOREN = ON // Brown-out Reset Enable->Brown-out Reset enabled |
| 58 | +#pragma config CLKOUTEN = OFF // Clock Out Enable->CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin |
| 59 | +#pragma config IESO = ON // Internal/External Switchover->Internal/External Switchover mode is enabled |
| 60 | +#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable->Fail-Safe Clock Monitor is enabled |
| 61 | +#pragma config WRT = OFF // Flash Memory Self-Write Protection->Write protection off |
| 62 | +#pragma config PLLEN = ON // PLL Enable->4x PLL enabled |
| 63 | +#pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable->Stack Overflow or Underflow will cause a Reset |
| 64 | +#pragma config BORV = LO // Brown-out Reset Voltage Selection->Brown-out Reset Voltage (Vbor), low trip point selected. |
| 65 | +#pragma config LVP = OFF // Low-Voltage Programming Enable->High-voltage on MCLR/VPP must be used for programming |
| 66 | + |
| 67 | +void SYSTEM_Initializer(void) |
| 68 | +{ |
| 69 | + OSCILLATOR_InitializerDefault(); |
| 70 | + PIN_MANAGER_Initializer(); |
| 71 | +} |
| 72 | + |
| 73 | + |
| 74 | +void OSCILLATOR_InitializerDefault(void) |
| 75 | +{ |
| 76 | + // SPLLEN disabled; SCS INTOSC; IRCF 500KHz_MF; |
| 77 | + OSCCON = 0x3A; |
| 78 | + // OSTS intosc; HFIOFR disabled; HFIOFS not0.5percent_acc; PLLR disabled; T1OSCR disabled; MFIOFR disabled; HFIOFL not2percent_acc; LFIOFR disabled; |
| 79 | + OSCSTAT = 0x00; |
| 80 | + // OSCTUNE 0x0; |
| 81 | + OSCTUNE = 0x00; |
| 82 | +} |
0 commit comments