:: Home :: Code Snippets :: Drivers :: Projects :: About ::
 Main Menu
  Home
  Code Snippets
  About

 Open Drivers
 PIC32 mcompat - PIC32 mcompat
 _build - Embedded build information
 qTask - Queued Task Manager
 EA-DOGM - LCD Display Driver

 Open Projects
 oLogic - Oscilloscope Logic Viewer
 oLogic 1.4 - NEW Logic Viewer
 SSX32 - Serial Servo Driver



 Sources
Prototyping
  PicStuff
  Sparkfun

Equipment
  Saelig
  Tequipment

Supply House
  Jameco
  Mouser
  Digikey
  Allied Electronics
  Clearwater Technologies

Miscellaneous
  BCM
  N34D Blog

Build Hex filename, embedded version, and time stamp

I did this code because a client wanted to have the compile date in the .hex file names.

At the same time, I needed to have a time stamp embedded in the controller, so I knew what release was running.

Here is a solution for both!

In your code, if you read the string (stored in ROM) _build[], you will have the time and date of compile.

19 bytes of ROM are used to store the build date and time _build[] string format: "31-Aug-09 23:55:18"
 Driver Specs
mcu: PIC12,16,18
compiler: CCS C

 Files
ex1.h
_build.c

_build.zip - All files


Here is an example of using the driver with a single +5v source and any pins you want from a pic.
 Example Usage
/vhost/mculabs/driver_db/_build/files/ex1.h
    1 
    2 // optional, these control the hex file name
    3 #define _BUILD_PROJECT "Prj_Name"
    4 #define _BUILD_VERSION "v1.0"
    5 
    6 #include "_build.c"
    7 

And here is the complete source file.
 _build.c
/vhost/mculabs/driver_db/_build/files/_build.c
    1 /*
    2           file: _build.c
    3        project: standard include
    4    description: Use for tracking build date and time and setting
    5                 the output hex file name
    6    written by : Michael Bradley
    7 
    8    Changelog:
    9             08/31/09 This module created
   10 
   11 
   12    USE:
   13       // optional, these control the hex file name
   14       #define _BUILD_PROJECT "Prj_Name"   
   15       #define _BUILD_VERSION "v1.0"
   16 
   17       #include "_build.c"
   18    
   19    REFERENCE:
   20    19 bytes of ROM are used to store the build date and time
   21    _build[] string format: "31-Aug-09 23:55:18"
   22 
   23 */
   24 
   25 
   26 const char _build[19] = {__DATE__ " " __TIME__};
   27 
   28 #ifdef _BUILD_PROJECT
   29    #define _BUILD_FILE _BUILD_PROJECT "-" _BUILD_VERSION "-" __DATE__ ".hex"
   30    #export (file=_BUILD_FILE, HEX)
   31 #endif
   32 
   33 






:: Home :: Resources :: PIC Microcontrollers ::
:: 10F :: 12F :: 16F :: 18F :: 24F :: 24H :: 30F :: 33F ::
(C) Copyright 2009 mculabs.com - contact: info@mculabs.com
0.080055952072144