Electronic Products
Find us here:
  • Chuck's Blog
    • Blog Posts Archive
    • Disclaimer
  • YouTube Channel
  • About Chuck
    • About Chuck
    • Stock Car Racing
  • Books
    • Embedded C Books >
      • cbookfiles
      • cbook2files
      • cbook3files
    • BASIC Books >
      • Programming PICs in BASIC_vol1
      • PICBasic Book Support
      • Basic Atom Book Support
    • Other Books >
      • Arduino Book
      • chipkitbookfiles
  • 3D Printing
    • Fabrikator Mini
  • Getting Started with PICs
    • BASIC Programming
    • C Programming >
      • C Compilers
  • Build Your Own PICKit 2
    • PICkit 2 Starter Kit
  • CHIPINO
    • Shields
  • CHIPAXE Breadboard Modules
  • Understanding Hex Files
  • chipKIT
  • Newsletter Archive
  • Contact
  • Retired Designs
    • BasicBoard
    • Ultimate OEM
    • Maximite BasicBox
    • Maximino
  • Downloads
  • Kickstarter Projects
    • Demo-Shield
  • Great Cow Basic Site
  • Buy Hardware
  • Links I Recommend

Cofiguration Settings

12/16/2013

0 Comments

 
Configuration settings are one of the more confusing topics to someone just getting started with Programming PIC Microcontrollers and often is the hurdle they have to get over to get that first LED to flash. The configuration settings enable the features of the micro. Settings, such as enabling the Debug feature, Low Voltage Programming or setting the Oscillator to internal or external are just some of the options. 

They are sometimes called fuses since in older one time programmable parts they were set once and couldn't be changed. But with today's modern flash memory devices, the configuration can be changed every time the part is programmed.

The configuration is really just a set of bits that get set or cleared to enable or disable the feature. These bits are grouped together into a byte or several bytes depending on how many features need to be configured.
Picture
A compiler will have a macro to set the configuration and it's usually placed at the top of a software program. Typically it's a line that starts with #config or __config and then followed by the nicknames for each bit setting.

One of the features I like about the Great Cow Basic compiler is the Graphical version that lets you select the part, the oscillator speed and each configuration setting from a drop down menu. Then when you select to build the file it will produce the BASIC and assembly language file with those settings. Shown below is an assembly file  __CONFIG line produced by the GCB Graphical compiler.
Picture
This one config line from the assembly file can be used as a reference for any other compiler since most use a similar CONFIG type line, though it will probably need a slight modification to match the compilers syntax.

Microchip's MPLAB X has a similar drop down menu option in the Configuration View. This is very useful for those programming with Microchip's tools. It's under the toolbar menu: Window>PIC Memory Views>Configuration Bits.
Picture
You also have the option to export your choices as a separate config.h file so you can include it at the top of your main.c file for all you C programmers out there. You can get details of all the config settings in the device data sheet under the special features section.


Bottom line is to don't forget to learn and understand the configuration settings for the device you are using and then set them once and kind of forget it. Then you'll be past that hurdle.
0 Comments



Leave a Reply.

    Sponsors


    Picture
    Picture
    Picture

    Advertise here for only $25 per month. 170x50 pixel add with graphics (similar to Howtronics above). 
    Contact us at our contact form for more detail.

    Categories

    All
    3D Printer
    Chipaxe
    Chipino
    Chipkit
    CNC
    Copper Connection
    Dot Matrix
    Elproductsnews
    Expresspcb
    Graphic Lcd
    Great Cow Basic
    Kickstarter
    Lcd Shield
    Makefaire
    Makercase
    Maximite
    Microchip Pic
    Pickit 2
    Pickit 3
    Videos

    Visit previous blog posts in the archives below.

    Archives

    February 2018
    October 2017
    September 2017
    July 2017
    November 2016
    August 2016
    July 2016
    May 2016
    March 2016
    January 2016
    November 2015
    September 2015
    August 2015
    July 2015
    June 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    October 2012
    October 2011

    RSS Feed



    About Chuck

    Chuck has been programming with PIC Microcontrollers since there were only five devices. Now there are over 700 and growing. He also has a lot of fun 3D printing designs using his Davinci 3D printer and TinkerCad software. In this series of blog posts and occasional videos on his YouTube Channel he tries to help you get started with electronics and 3D printing.

    Disclaimer

Powered by Create your own unique website with customizable templates.