gnupic: (SDC)C and PICs
Subject:
Re: (SDC)C and PICs
From:
Antti Siipola ####@####.####
Date:
4 Oct 2002 07:58:36 -0000
Message-Id: <20021004075600.GA21477@ansi.paju.fi>
On Tue, Oct 01, 2002 at 13:39:28 +0300, Antti Tuominen wrote:
> After a year's break I'm reviving my pic projects, this time trying SDCC
> instead of c2c and I'm having problems doing pic-specific stuff with it.
Try searhing this mailing list's archives, most of your questions have
been asked before.. I've compiled SDCC from CVS and I guess it is
advisable to do so as the PIC port is (was?) under active development.
> 1) How can I define an interrupt handler? I tried to mimic absolute
> addressing syntax for variables and language extensions for other targets,
> but didn't have much success.
AFAIK, one can define an interrupt handler like this:
void general_intr() interrupt 0
The compiler gives some warnings about a missing label but the
genereted assembly seems ok.
> 2) How do I define the target pic? Is it the "#define __16FXXX" trick as in
> the regression test sources? I tried that, but the resulting .asm still says
> 'include "p16c84.inc"'.
I'm using this method too and it works for me.
> 3) From where do the C .h includes for different pics come from? Were they
> available for download somewhere or was it some tool that translated the
> original gpasm-includes?
You must generate them by yourself with the inc2h.pl -program that can
be found from the support/scripts -directory (in the SDCC sources).
> Any help or pointers would be greatly appreciated. If someone has example
> code for the SDCC, it would probably answer most of my questions.
An informative email from Scott Dattalo was posted here, see
http://www.linuxhacker.org/cgi-bin/ezmlm-cgi?1:mss:1241:bgdodfdgofpljbkgfdnp
Someone posted quite complicated program listing that did some a/d
conversion and serial I/O, unfortunately I've lost the link, try
searhing the archives.
--
Antti Siipola
####@####.####
GSM: +358 44 5413147