Great Cow BASIC Maintenance

Introduction: Great Cow BASIC maintenance covers the key processess that the developers use to maintain and build the solution.

This insights are not distribution specific

Solution Architecture: Complete the components are key for a complete solution:

  1. Great Cow BASIC installer
  2. Great Cow BASIC chip specific .DAT files
  3. Great Cow BASIC Help
  4. Great Cow BASIC IDE

Great Cow BASIC installer:

The Great Cow BASIC installer used the InnoSoft installer with packaging completed using R2Build.

The process uses a Gold build structure. The R2Build software creates four packages for Windows and one package for the Linus distribution. The process is automated with automatic versioning and configuration.

Great Cow BASIC chip specific .DAT files:

What are the .DAT files?

The DAT files are the Great Cow BASIC respresentation of capabilities of a specific microcontroller.  The DAT is based upon a number of vendor sources and corrections/ommissions added by the Great Cow BASIC development team.  The DAT file is exposed to the user program as a set of registers and register bits that can used to configure the program in terms of the microcontroller specifics.

The process to create the .DAT file for chips is as follows:

Step Description


Obtain the MPASM *.INC or the AVR *.XML files to be used. These files determine the scope of registers and register bits.


For Microchip only. Place the source INC files in the ..DAT\incfiles\OrgFiles.

Process the file using 'Preprocess.bat'.    This is an AWK text processor - you will required AWK.EXE in the executing folder.

This preprocessing will examine all the INC files in the ..DAT\incfiles\OrgFiles folder.  The resulting files will be placed in the ..DAT\incfiles folder.  The resulting files will have the 'BITS' section sorted in port priority - this priority ensures the bits are assigned in the target DAT in the same order everytime.


Update the database of support microcontrollers.  This database contains the microcontroller configuration that Great Cow BASIC requires as the core information for the DAT files.

The database is called chipdata.csv or avr_chipdata.csv for Microchip and AVR respectively. - These files are comma delimited.  The first row of data specifies the field name - these field names control the chip conversion program, see later notes.  

The database fields are controlled by the Great Cow BASIC development team and the specification of the database may change between release to support new capabilities.

Database fields will the suffix of Variant such as PWMTimerVariant and SMTClockSourceVariant are microcontroller specific configuration settings to support the various microcontroller settings.  These values of these variants is determined by the examination of the microcontrollers datasheet as this information is NOT specified in the source files.  Variants are exposed in the user program with the prefix of Chip.  If the variant is called PWMTimerVariant a constant caled ChipPWMTimerVariant will be exposed in the user program.


Update the CriticalChanges.txt file, if required.  The CriticalChanges.txt file contains changes the INC file during processing that are corrections or additions to the source files.

The format of each line is the filename , Append (new line) or Replace, find, replace.

Each line is comma delimited and spaces are NOT critical.   Essentially, the processing with find a partial line and replace or append the whole line.

example:,R,OSCFIE EQU H'0007',OSFIE EQU H'0007'     - so, when processing find the line OSCFIE EQU H'0007' and replace with OSFIE EQU H'0007'.


If required.   This is not normally edited.    Update the 18FDefaultASMConfig.txt to set the 18f configuration defaults.


Maintain the conversion program.  The conversion program may require maintenance.   The programs are written in FreeBASIC and therefore require compilation.

Examples of maintenance is- a new variant field is required.  The source program will need to be update to support the new variant - simply edit the source, compile and publish.  Another example is the addition of new Interrupt - follow the same process to edit, compile and publish.


Execute the program to convert the source files to the DAT files for Microchip or AVR.  There are two programs for each architecture.

Executing the conversion program without a parameter will process ALL the entries in the database (the csv file), passing a single parameter to the conversion program will only convert the single microcontroller.

The conversion program will process as follow:

a) Read the database for the chip specifics

b) If a .DEV file or .INFO file is not present a routine called GuessDefaultConfig. This method sets the bit(s).

In all cases the default mask is sometimes specified for a particular config option and that is used for ASMConfig

See the section below for the processing of a .DEV file.

c) For all microcontrollers read the CriticalChanges.txt and process.

d) For 18f microcontrollers read the 18FDefaultASMConfig.txt. This simply overwrites all options stated in 18FDefaultASMConfig.TXT and marks this in the output DAT file.

e) Create the output DAT file.


Test and publish the DAT file(s) to the distribution as required.

An example the processing of a .DEV.

This is the 18F25K20 example. For this microcontroller Disabled is default:


Where the default is selected from the Info_Type.