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 Project or Idea!?

I am Available for Freelance Projects

My skills are always primed and ready for new opportunities to be put to work, and I am ever on the lookout to connect with individuals who share a similar mindset.

If you’re intrigued and wish to collaborate, connect, or simply indulge in a stimulating conversation, don’t hesitate! Drop me an email and let’s begin our journey. I eagerly anticipate our interaction!

jamie@jamiestarling.com


Pin It on Pinterest

Share This