gnupic: SDCC Pic Port


Previous by date: 19 May 2002 14:11:43 -0000 Re: SDCC PIC Port, Linas Vepstas
Next by date: 19 May 2002 14:11:43 -0000 SDCC newbie .... First of many questions ..., Robert Warner
Previous in thread: 19 May 2002 14:11:43 -0000 Re: SDCC PIC Port, Linas Vepstas
Next in thread: 19 May 2002 14:11:43 -0000 SDCC PIC Port, Scott Dattalo

Subject: Re: SDCC PIC Port
From: Scott Dattalo ####@####.####
Date: 19 May 2002 14:11:43 -0000
Message-Id: <Pine.LNX.4.44.0205190653270.4765-100000@ruckus.brouhaha.com>

On Sun, 19 May 2002, Linas Vepstas wrote:

> 
> On Thu, May 16, 2002 at 10:15:49PM -0700, Scott Dattalo was heard to remark:
> > 
> > It's been a while since I've said anything about SDCC. A lot has changed. 
> > I'm not even sure where to begin.
> > 
> > data at 0xa2 unsigned int  ui_bank1_temp=0;
> > 
> > and you can do it with bits too:
> > 
> > #define BIT_AT(base,bitno) bit at ((base<<3)+bitno)
> > #define TRISB_ADR  0x86
> > 
> > BIT_AT(TRISB_ADR,0) TRISB0;
> > 
> > -- Config word is supported
> > 
> > #define _WDT_OFF         0x3FFB
> > #define _PWRTE_ON        0x3FF7
> > 
> > typedef unsigned int word;
> > 
> > word at 0x2007  CONFIG = _WDT_OFF & _PWRTE_ON;
> 
> It sure would be nice if someone put together an SDCC-PIC howto 
> that included the above information.  Its all too easy to loose a few
> afternoons figuring out the stuff above on one's own; never mind one has
> to be clever to figure it out ....

This would be nice. This info should propogate into the documentation too. 

> 
> But if one does figure it out, one is rewarded... I was able to write a
> fairly long program (some 6 or 8 subroutines, maybe approaching a KLOC
> of C code) that, with a few bug work-arounds, works fine (it does a/d
> conversions on the 16f873, and spits stuff out on the serial port).

This is quite surprising! It sounds like SDCC is more usable than I had 
thought.

> 
> So I think SDCC is quite usable by the more adventurous ...
> 
> > -- bugs, bugs, and more bugs were fixed. A special thanks goes to Linas 
> > Vepstas for numerous bug reports.
> 
> Don't know how many of these bugs got fixed.  

You reported about a dozen and I fixed all but two. I also fixed several 
more bugs related to these (the whole right shift thing is broken for 
longs).

>                                              The howto might want to
> discuss bug-work-arounds.  For example, I tripped on the following
> 'feature':
> 
> const char *mystr = "Hello, World!\n";
> 
> works find in SDCC, but 
> 
> char *mystr = "Hello, World!\n";
> 
> does not (the former goes into program memory, since its const; the
> latter goes into data registers, since its not const, and might be
> altered by the program.  PICs have a whole lot more program memory than
> data memory ...).

This is one of the bugs I did not "fix". I looked at it and decided to 
hold off for now. All that needs to be done is to allocate space in RAM 
and copy the string there. 

The only other outstanding bug you reported is the pointer passing 
smashing one. You have a simple work-around (patch), so for now I'm 
letting slip. I have too many other ones to tackle first!

Scott


Previous by date: 19 May 2002 14:11:43 -0000 Re: SDCC PIC Port, Linas Vepstas
Next by date: 19 May 2002 14:11:43 -0000 SDCC newbie .... First of many questions ..., Robert Warner
Previous in thread: 19 May 2002 14:11:43 -0000 Re: SDCC PIC Port, Linas Vepstas
Next in thread: 19 May 2002 14:11:43 -0000 SDCC PIC Port, Scott Dattalo


Powered by ezmlm-browse 0.20.