Anobium - 2024-08-01

Generating DAT for the AVRDX chip is simple. I have written a converter that automatically generates the DAT from two sources.

  1. MPLAB IDE. An installation of MPLAB-IDE is required for this process.
  2. An XLS

The executable and the source is in GitHub. https://github.com/GreatCowBASIC/DATFileGenerator

There is an XLS ( in GitHub as it has been for years), which has the basic information for all AVR chips. And the XLS has an entry per chip ( not optional ), and, the new executable.

To use the executable you run AVRDX_to_DATv7.exe.

  1. With no parameter the program will list ALL the chips supported by MPLAB IDE.
  2. The chipname as a parameter, i.e. mega4809’. This will process the latest version of the DFP file as the DAT file. Pipe the output to the target filename i.e.mega4809.dat`.

The executable can be edited and recompiled using FreeBASIC( FBC ). FBC is same folder as the executable and using FBC AVRDX_to_DATv7.bas will recompile,

The executable is an adapted version of the PIC generator but this generated a DAT ( the PIC version generates an INC file).

The executable is processes the source files as follows:

  • InitAndGetFiles – opens MPLAB-IDE, determines the chip version from the XML.
  • PrintHeader – outputs the file with lots of useful information.
  • PrintChipData – outputs the DAT file header using the MPLAB and XLS data sources.
  • PrintPointers – outputs the DAT file pointers section.
  • PrintInterrupts – outputs the DAT file interrupt section from MPLAB source.
  • PrintAliases – outputs the DAT file aliases section based on MPLAB source.
  • Printregisters – outputs the DAT file register section from MPLAB source.
  • PrintBits – outputs the DAT file bits section from MPLAB source.
  • PrintFreeRam – outputs the DAT file freeram section from MPLAB source.
  • PrintFooter - – outputs the DAT file footer sections.

Usage

A simple example is AVRDX_to_DATv7 mega4809 > mega4809.dat


Notes

You get the message Not a valid chip, or no DFP files .. NOCHIP - … - You need to update MPLAB-IDE using the DFP manager to download the pack that has the chip included. By default not all chips are available with in MPLAN-IDE and you need to update the DFPs.

The executable searches your local MPLAB-IDE DFP sources. The latest DFP will be used – this is automatic.

The version of MPLAB-IDE is hard coded. Simply edit the source, change the version and recompile.


Enjoy - this is now a simple process and no longer a black art.

 
❤️
1

Last edit: Anobium 2024-08-01