I have been experimenting with the SDCC port for the PIC18 family of
micrcontrollers. In SDCC that is the pic16 port. I have made some changes to
the sources and the configuration scripts so that SDCC can be compiled with
pic16 support. If the SDCC development team is interested I can send them
the patches.
Now lets go for the bug:
In order to compile a program for the PIC one should use the script inc2h.pl
that resides in the support/scripts directory.
I run the script for the 18f442 microcontroller, but the generated header
file missed some pragma's and many macros.
The problem is that the current version of inc2h.pl ignores all the SFRs
after address 0x0FD5.
Looking in the p18f442.inc (which is a part of the gputils library, I had
version 0.11.... I think) at line 133 has the following comment:
;RESERVED_0FD4 EQU H'0FD4
If one deletes this comment, inc2h.pl script continues until another comment
is reached.
I do not now anything about Perl, so the best I could do is to remove
similar comments from the .inc file.
Would someone be interested to find and correct the bug?
The second comment has to do with the gputils p18f442.inc file (and possibly
other files of this series) at line 294 there is the following text:
;----- OSCON Bits ---------------------------------------------------------
SCS EQU H'0000'
Which of course is interpreted wrong by the inc2h.pl because the name of the
SFR is OSCCON and not OSCON. One should correct the mistake in the
p18f442.inc file (and perhaps all the similar) before runs the inc2h.pl
script.
I'll send this comment to the gnupic list to be corrected.
Now I have some questions about he pic16 port. Is it completed? SDCC does
not even generate code for some pieces of code!
and finally, why it is named pic16 and not pic18? I think it is more
obvious!!!
Vangelis Rokas
|