Select Page

Lets make things a little easier on ourselves by defining a standard header file for our PIC10F322 Projects.

I named the file 10F322_deviceconfig.h and place it into my XC8 project directory.

To use it, I add it to the headers in my XC8 project and include – #include “10F322_deviceconfig.h” in the source file or files.

The header file contains the device configuration setup, and some other standard headers I use, along with _XTAL_FREQ and some other defines that I find important to have, like values for true, false, off, on..

/*
 * File:  10F322_deviceconfig.h
 * Author: Jamie Starling - JamieStarling.com 
 *
 * Created on:  June 7, 2019, 9:45 PM
 * 
 * Copyright 2018 - 2019 Jamie Starling


THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

 * 
 * Purpose : Provides Standard Configuration for 10F32X devices
 * 
 */


#include 
#include 

#ifndef DEVICECONFIG_H
#define	DEVICECONFIG_H

#pragma config FOSC = INTOSC  // Oscillator Selection 
#pragma config BOREN = ON    // Brown-out Reset
#pragma config WDTE = OFF    // Watchdog Timer
#pragma config PWRTE = ON    // Power-up Timer
#pragma config MCLRE = OFF   // MCLR Pin Function Select bit->MCLR pin function is digital input, MCLR internally tied to VDD
#pragma config CP = OFF      // Code Protection 
#pragma config LVP = OFF     // Low-Voltage Programming 
#pragma config LPBOR = ON    // Brown-out Reset Selection bits
#pragma config BORV = LO    // Brown-out Reset Voltage Selection
#pragma config WRT = OFF    // Flash Memory Self-Write Protection


#define ON  1
#define OFF 0
#define TRUE 1
#define FALSE 0
#define HIGH 1
#define LOW 0


//Used to calculate the delay time - Change depending on processor Speed
#define _XTAL_FREQ 8000000  //8 MHz (default after Reset)


#endif	/* DEVICECONFIG_H */

Have a technology project in mind? Let’s talk!

I am currently available for hire

Need a custom technology solution for your business? Please send me an email (jamie@jamiestarling.com) to discuss your project needs.

I can help you get started on the road of building a simple and well-tested working solution, together, with your team.