Skip to content
This repository was archived by the owner on Feb 11, 2021. It is now read-only.

Commit 79b445f

Browse files
committed
Initial Commit
0 parents  commit 79b445f

23 files changed

+1315
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

16F1825_led.X/.DS_Store

6 KB
Binary file not shown.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*******************************************************************************
2+
Generated MPLAB® Code Configurator Header File
3+
4+
Company:
5+
Microchip Technology Inc.
6+
7+
File Name:
8+
code_manager.h
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+
#ifndef CODE_MANAGER_H
49+
#define CODE_MANAGER_H
50+
#include <xc.h>
51+
#include "pin_manager.h"
52+
53+
#define _XTAL_FREQ 500000
54+
55+
/**
56+
* @prototype void SYSTEM_Initializer(void)
57+
* @param none
58+
* @return none
59+
* @description Initializes the device to the default states configured in the
60+
* PCG GUI
61+
* @usage SYSTEM_Initializer(void);
62+
*/
63+
void SYSTEM_Initializer(void);
64+
65+
/**
66+
* @prototype void OSCILLATOR_Initializer(void)
67+
* @param none
68+
* @return none
69+
* @description Initializes the oscillator to the default states configured in the
70+
* PCG GUI
71+
* @usage OSCILLATOR_Initializer(void);
72+
*/
73+
void OSCILLATOR_InitializerDefault(void);
74+
#endif /* CODE_MANAGER_H */
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*******************************************************************************
2+
Generated Pin Manager File
3+
4+
Company:
5+
Microchip Technology Inc.
6+
7+
File Name:
8+
pin_manager.c
9+
10+
Summary:
11+
This is the Pin Manager file generated using MPLAB® Code Configurator
12+
13+
Description:
14+
This header file provides implementations for pin APIs for all pins 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 <xc.h>
49+
#include "pin_manager.h"
50+
51+
/****************************************************************************
52+
*
53+
* Prototype: void PIN_MANAGER_initializer(void)
54+
* Input: none
55+
* Output: none
56+
* Description: GPIO and peripheral I/O initialization
57+
* Usage: PIN_MANAGER_initializer();
58+
*
59+
***************************************************************************/
60+
61+
void PIN_MANAGER_Initializer(void)
62+
{
63+
LATA = 0x00;
64+
TRISA = 0x3F;
65+
ANSELA = 0x17;
66+
WPUA = 0x00;
67+
68+
LATC = 0x02;
69+
TRISC = 0x3C;
70+
ANSELC = 0x0C;
71+
WPUC = 0x00;
72+
73+
IOCAP = 0x00;
74+
75+
IOCAN = 0x00;
76+
77+
IOCAF = 0x00;
78+
79+
APFCON0 = 0x00;
80+
81+
APFCON1 = 0x00;
82+
}

0 commit comments

Comments
 (0)