Re: want an sdcc howto?

Byron A Jeff <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.gnupic
Message-ID <[email protected]>
On Fri, Jul 15, 2005 at 12:58:30PM +1200, David McNab wrote:
> Hi,
> 
> My preference for high-level langages puts me at odds with much of this
> list's membership, but there are those who feel the same as I do.

I think at odds is too strong a turn of phrase, David. I believe that 
everyone on the assembly side of the discussion believes that there is an
advantage to having a reading level understanding of PIC assembly. With that
in hand, you can converse and do conversions between the high level language
and PIC assembly as needed.

With such a limited instruction set, exposure to as little as 3 or 4
programs can get folks to that reading level.

I don't have an aversion to HLL's on the PIC. I've written one:

http://www.finitesite.com/d3jsys/README-NPCI.html

But it also has a hook for assembly language routines that are attached
to the interpreter too.

I believe that you need to know both assembly and HLL. Not necessarily 
write in both. But a reading level understanding and a level of comfort
in translating between them.

> The problem with high level languages on PIC micros has been the lack of
> a usable, free/opensource implementation.

Completeness and support are also issues. JAL and sdcc have been around
for several years. gpal is making strides. NPCI has been standing still
for about 4 or 5 years now. But I'm planning on pulling it out and dusting 
it off in the very near future.

> sdcc has suffered a bad rap because it's very newbie-unfriendly to set
> up and get going. Also, its binary packaging has been botched, at least
> on Debian.

I don't think I've looked at it since Scott was actively working on it.
Of course I haven't actively worked on NPCI either. So that isn't a big
deal.

> But with a bit of doco, this problem can go away, to the point where
> sdcc's accessibility is on a par with that of the commercial compilers.

Brilliant!!! (where's my Guinness? ;-)

> I'm willing to write an 'sdcc on PIC Howto', which takes the user step
> by easy step through:
> 
>   - downloading the source tarball
>   - configuring the build
>   - building the core toolchain and extras
>   - installing the toolchain, libs, headers and support files
>   - writing a 'hello, world' LED blinker program in C
>   - turning that into a valid and working .hex binary (including
>     a fix for the broken crt0 module)
>   - setting up and using usart-based stdio (so 'printf()' works)
>   - practicalities of C hacking on PIC

Will the last bullet have some assembly/translation discussion? Something
along the lines of "If you see this type of code in assembly, this is the
translation in sdcc."

Is there an overview of library support?

> Question is - is any interested in actually seeing/using such a
> document?

YES!!! YES!!!! PLEASE?!!!! YES!!!!

Emphatic enough?

> I'd rather get some votes of support before launching in and
> expending several hours on something that might not be used.

Tell me where it is and I'll put a pointer on my site. I already have
a "Cool Languages" page. I'll happily add sdcc and a pointer to you page 
to it. Just let me know.

> I'd really like to see more interest in sdcc on this list, because it's
> the only viable free/opensource high-level language compiler that spans
> both 16F and 18F, and deserves a place as the 'reference' high level
> language for PIC.

I'll give it a spin. 

I appreciate the offer. I'm going to be back in the game almost immediately
and would be happy to have an HLL to develop in.

In closing I'd like to reiterate that assembly and HLL isn't a debate.
Both are viable tools. What I think is missing is a bridge between them.
That's not a request for you to write that bridge. Just an observation
that it needs to be constructed.

How soon can you put a barebones draft together? Something where I can
start from the top with a 16F88 or a 18F1330 and be blinky and serial?
It doesn't have to be fancy. It just needs all the steps.

> Thoughts?

Consider me your first alpha tester.

Thanks, David. I admire your passion on the subject.

BAJ
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.