|
From: Francesco M. <f18...@ya...> - 2009-02-28 14:30:43
|
Hi Frans,
I'm looking at implementing loading PIC data from Piklab XML as we talked
about some time ago.
This would allow to have an "Info" page next to the "Code", "Cfg flags" and
"Data" current pages with lots of info about the selected PIC and to have the
"Configuration flags" page reorganized to contain e.g. an array of checkboxes
which indicate "Oscillator type", etc etc. This last feature in particular would
help very much IMO (looking at the flags in hexadecimal form is quite ugly).
Looking at the UPP source file, for example for PIC16F84A, I see:
{
"P16F84A", //Name
0x1FF*2, //CodeSize
0x2007, //ConfigAddress
0x2100, //DataAddress in hex file
0x40, //Datasize
0x2, //ConfigSize
P16F84A, //PicFamily
0x0560, //DevId
0x3FE0, //DevIdMask
{0xFF,0x3F}
},
the relative XML data is:
<device name="16F84A" ... id="0x0560" ...>
....
<!--* Memory ***************************************************************-->
<memory name="code" start="0x0000" end="0x03FF" />
<memory name="user_ids" start="0x2000" end="0x2003" rmask="0x007F" />
<memory name="device_id" start="0x2006" end="0x2006" />
<memory name="config" start="0x2007" end="0x2007" />
<memory name="eeprom" start="0x0000" end="0x003F" hexfile_offset="0x2100" />
<!--* Configuration bits ***************************************************-->
<config offset="0x0" name="" wmask="0x3FFF" bvalue="0x3FFF" >
<mask name="FOSC" value="0x0003" >
<value value="0x0000" name="LP" cname="_LP_OSC" />
<value value="0x0001" name="XT" cname="_XT_OSC" />
<value value="0x0002" name="HS" cname="_HS_OSC" />
<value value="0x0003" name="EXTRC_CLKOUT" cname="_RC_OSC" />
</mask>
<mask name="WDT" value="0x0004" >
<value value="0x0000" name="Off" cname="_WDT_OFF" />
<value value="0x0004" name="On" cname="_WDT_ON" />
</mask>
<mask name="PWRTE" value="0x0008" >
<value value="0x0000" name="On" cname="_PWRTE_ON" />
<value value="0x0008" name="Off" cname="_PWRTE_OFF" />
</mask>
<mask name="CP" value="0x3FF0" >
<value value="0x0000" name="All" cname="_CP_ON" />
<value value="0x3FF0" name="Off" cname="_CP_OFF" />
<value value="default" name="invalid" />
</mask>
</config>
....
</device>
So that the info we currently keep in pictype.cpp could be loaded from (using a
pseudo syntax to refer to the XML tags and XML attributes):
typedef struct {
string Name; <== "P"+ <device@name>
int CodeSize; <== <memory@name="code"@end> - <memory@name="code"@start>
int ConfigAddress; <== <memory@name="config"@start>
int DataAddress; //in hex file <== <memory@name="eeprom"@hexfile_offset>
int DataSize; <== <memory@name="eeprom"@end> - <memory@name="eeprom"@start>
int ConfigSize; <== <memory@name="config"@end> - <memory@name="config"@start>
PicFamily picFamily;
int DevId; <== <device@id>
int DevIdMask;
int ConfigMask[16];
} Pic;
stuff that seems cannot be loaded from XML is thus:
1) PicFamily picFamily;
This is a number corresponding to the UPP internal classification of
the PIC families and thus is obviously not present in Piklab XML files.
I think we can't do nothing about this.
2)
int DevIdMask;
int ConfigMask[16];
maybe I'm just missing something but this data cannot be derived from the data
contained in Piklab XML files in some way?
It would be nice to be able to load all data from the Piklab XML files without
being forced to modify them so that we could simply overwrite our XML files with
Piklab's updated ones from time to time.
Thanks,
Francesco
--
|