gnupic@linuxhacker.org
gnupic@linuxhacker.org
Charles Lepple wrote:
>
> Vangelis Rokas said:
> > The problem is in the comment. The official name of the SFR is OSCCON
> > and OSCON, which is important even if it is placed in comment, because
> > SDCC uses a script file which creates various macros based on the
> > comment text.
>
> So long as the SDCC header script relies on comment parsing for register
> definitions, it will be prone to these sorts of errors. I tried to add
> some "intelligence" to the script to handle the PIC16C745/765 USB
> registers, and only succeeded in proving to myself that I still know how
> to make write-only Perl code :-)
>
The header files come from MPLAB. I don't want to maintain a seperate
set of files. Has any one told Microchip? They might fix it. I will
ask.
> [dons flame-proof vest]
>
> I know most of the people on this list don't like the idea of playing
> around with MPLAB, but since gputils is pretty much going to be playing
> catch-up to MPLAB for the foreseeable future, it really can't hurt to
> install MPLAB every once in a while to see what's new.
>
> MPLAB 6 has a nice feature in the "...\MPLAB IDE\Device" directory:
> machine-readable descriptions of each processor's registers and memory
> maps.
>
> For instance:
>
> format=0.1
>
> #device=PIC16C765
>
> vpp (range=12.750-13.250 dflt=13.000)
> vdd (range=4.500-5.250 dfltrange=4.500-5.250 nominal=5.000)
>
> pgmmem (region=0x00-0x1FFF)
> cfgmem (region=0x2007-0x2007)
> testmem (region=0x2000-0x20FF)
> userid (region=0x2000-0x2003)
>
> NumBanks=4
> MirrorRegs (0x0-0x0 0x80-0x80 0x100-0x100 0x180-0x180)
> [...]
> sfr (key=ADCON0 addr=0x1F size=1)
> reset (por='' mclr='')
> bit (names='ADCS1 ADCS0 CHS2 CHS1 CHS0 GO - ADON')
> bit (names='- - - - - NOT_DONE - -')
> sfr (key=ADCON1 addr=0x9F size=1)
> reset (por='' mclr='')
> bit (names='- - - - - PCFG2 PCFG1 PCFG0')
>
> If I had time to fix it, I'd try and use these files. In fact, what
> might be nice is a Perl class to insulate programmers from any changes
> to this file format. I don't know what Microchip's license policy is on
> these files, but there isn't so much as a copyright notice on them, and
> since they were so kind as to provide the MPASM testsuite way back when,
> they may be amenable to putting an agreeable license on these files as
> well.
>
That is a good idea. I will send them a quick message and find out.
> These files are at least used by the simulator UI, as I was able to create
> my own register in one of the existing .dev files.
>
> --
> Charles Lepple <clepple@ghz.cc>
> http://www.ghz.cc/charles/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: gnupic-unsubscribe@linuxhacker.org
> For additional commands, e-mail: gnupic-help@linuxhacker.org
gnupic@linuxhacker.org