comp.lang.ada
 help / color / mirror / Atom feed
* GNAT and Atmel AVR Microcontrollers
@ 2001-12-09 21:13 Michael Bode
  2001-12-09 22:51 ` Florian Weimer
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Bode @ 2001-12-09 21:13 UTC (permalink / raw)


Hi,

since gcc has support for the Atmel AVR series of microcontrollers and
gcc 3.1 is supposed to have gnat included, does that mean that from
gcc 3.1 on I will be able to programm AVRs in Ada with a plain vanilla
gcc (if I build gcc from the sources configured as a cross compiler)? 



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-09 21:13 GNAT and Atmel AVR Microcontrollers Michael Bode
@ 2001-12-09 22:51 ` Florian Weimer
  2001-12-10  6:27   ` Michael Bode
                     ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Florian Weimer @ 2001-12-09 22:51 UTC (permalink / raw)


Michael Bode <m.g.bode@web.de> writes:

> since gcc has support for the Atmel AVR series of microcontrollers and
> gcc 3.1 is supposed to have gnat included, does that mean that from
> gcc 3.1 on I will be able to programm AVRs in Ada with a plain vanilla
> gcc (if I build gcc from the sources configured as a cross compiler)? 

Most likely no, if there's no Ada run-time library for the Atmel AVR
and its OS (haven't checked this, though).



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-09 22:51 ` Florian Weimer
@ 2001-12-10  6:27   ` Michael Bode
  2001-12-10  9:12   ` Hans-Olof Danielsson
  2001-12-10 16:19   ` Stephen Leake
  2 siblings, 0 replies; 16+ messages in thread
From: Michael Bode @ 2001-12-10  6:27 UTC (permalink / raw)


Florian Weimer <fw@deneb.enyo.de> writes:

> Most likely no, if there's no Ada run-time library for the Atmel AVR
> and its OS (haven't checked this, though).

Probably there is no run-time lib. So how do you get a runtime library
for a new device? Simply recompile with the new compiler will probably
not work? Ah, and the AVR is a 8 bit controller, it has no OS. Anyway
one would only need some sort of runtime library "light" since things
like file I/O are not needed. And maybe bindings to some special C
library functions for accessing I/O ports and special registers on the
AVR. 

BTW: are there any GNAT versions for other small (8 or 16 bits)
microcontrollers?



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-09 22:51 ` Florian Weimer
  2001-12-10  6:27   ` Michael Bode
@ 2001-12-10  9:12   ` Hans-Olof Danielsson
  2001-12-10 16:19   ` Stephen Leake
  2 siblings, 0 replies; 16+ messages in thread
From: Hans-Olof Danielsson @ 2001-12-10  9:12 UTC (permalink / raw)
  To: comp.lang.ada

"Florian Weimer" <fw@deneb.enyo.de> wrote:
> Michael Bode <m.g.bode@web.de> writes:
> 
> > since gcc has support for the Atmel AVR series of microcontrollers and
> > gcc 3.1 is supposed to have gnat included, does that mean that from
> > gcc 3.1 on I will be able to programm AVRs in Ada with a plain vanilla
> > gcc (if I build gcc from the sources configured as a cross compiler)? 
> 
> Most likely no, if there's no Ada run-time library for the Atmel AVR
> and its OS (haven't checked this, though).

Would pragma NO_RUN_TIME be helpfull here, allowing a subset of
Ada to be used?





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-09 22:51 ` Florian Weimer
  2001-12-10  6:27   ` Michael Bode
  2001-12-10  9:12   ` Hans-Olof Danielsson
@ 2001-12-10 16:19   ` Stephen Leake
  2001-12-11 13:04     ` Karl Ran
  2 siblings, 1 reply; 16+ messages in thread
From: Stephen Leake @ 2001-12-10 16:19 UTC (permalink / raw)


Florian Weimer <fw@deneb.enyo.de> writes:

> Michael Bode <m.g.bode@web.de> writes:
> 
> > since gcc has support for the Atmel AVR series of microcontrollers and
> > gcc 3.1 is supposed to have gnat included, does that mean that from
> > gcc 3.1 on I will be able to programm AVRs in Ada with a plain vanilla
> > gcc (if I build gcc from the sources configured as a cross compiler)? 
> 
> Most likely no, if there's no Ada run-time library for the Atmel AVR
> and its OS (haven't checked this, though).

However, if you are willing to use the C runtime (no tasking, no
dynamic allocation, possibly no exceptions), it is not hard to get a
subset of Ada working.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-10 16:19   ` Stephen Leake
@ 2001-12-11 13:04     ` Karl Ran
  2001-12-11 17:28       ` Stephen Leake
  2001-12-21 14:40       ` Erik Johannessen
  0 siblings, 2 replies; 16+ messages in thread
From: Karl Ran @ 2001-12-11 13:04 UTC (permalink / raw)


Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> wrote in message news:<u3d2jujwy.fsf@gsfc.nasa.gov>...

> > Most likely no, if there's no Ada run-time library for the Atmel AVR

> > and its OS (haven't checked this, though).

> 

> However, if you are willing to use the C runtime (no tasking, no

> dynamic allocation, possibly no exceptions), it is not hard to get a

> subset of Ada working.



That sounds intresting!
How much time would it take for a C&Ada programmer to get this mini AVR-Ada
working?

Karl



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-11 13:04     ` Karl Ran
@ 2001-12-11 17:28       ` Stephen Leake
  2001-12-12 20:13         ` Michael Bode
  2001-12-21 14:40       ` Erik Johannessen
  1 sibling, 1 reply; 16+ messages in thread
From: Stephen Leake @ 2001-12-11 17:28 UTC (permalink / raw)


karlran1234@yahoo.com (Karl Ran) writes:

> Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> wrote in message news:<u3d2jujwy.fsf@gsfc.nasa.gov>...
> > > Most likely no, if there's no Ada run-time library for the Atmel AVR
> > > and its OS (haven't checked this, though).
>
> > However, if you are willing to use the C runtime (no tasking, no
> > dynamic allocation, possibly no exceptions), it is not hard to get a
> > subset of Ada working.
> 
> That sounds intresting!
> How much time would it take for a C&Ada programmer to get this mini AVR-Ada
> working?

Well, unfortunately, the honest answer is "it depends how good you are
at compiling and fixing gcc and similar programs".

It also depends on how weird your processor is. If it supports 8 bit
memory reads, has a flat Von Neumann memory architecture, and
hardware floating point, you're in good shape. Ada cares more about
this stuff than C does. If you don't have 8 bit reads, you won't have
the standard Character type without a lot of work. In C, you just say
"char is 16 bits" and move on.

I have not actually finished doing this for a processor, but I've
started a couple times. I'd guess six person-months for a good first
effort.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-11 17:28       ` Stephen Leake
@ 2001-12-12 20:13         ` Michael Bode
  0 siblings, 0 replies; 16+ messages in thread
From: Michael Bode @ 2001-12-12 20:13 UTC (permalink / raw)


Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> writes:

> Well, unfortunately, the honest answer is "it depends how good you are
> at compiling and fixing gcc and similar programs".

Hm, don't know. Never tried it ;-)

> It also depends on how weird your processor is. If it supports 8 bit
> memory reads, has a flat Von Neumann memory architecture, and
> hardware floating point, you're in good shape. 

8 bit, Harvard architecture, no hardware floating point. I guess this
doesn't look too good. Which leads to my 2nd question: is there a
free/cheap Ada compiler for any microcontroller at all?




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-11 13:04     ` Karl Ran
  2001-12-11 17:28       ` Stephen Leake
@ 2001-12-21 14:40       ` Erik Johannessen
  2001-12-26 13:08         ` Karl Ran
  1 sibling, 1 reply; 16+ messages in thread
From: Erik Johannessen @ 2001-12-21 14:40 UTC (permalink / raw)


karlran1234@yahoo.com (Karl Ran) writes:

> Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> wrote in message news:<u3d2jujwy.fsf@gsfc.nasa.gov>...
> 
> > > Most likely no, if there's no Ada run-time library for the Atmel AVR
> > > and its OS (haven't checked this, though).
> > 
> > However, if you are willing to use the C runtime (no tasking, no
> > dynamic allocation, possibly no exceptions), it is not hard to get a
> > subset of Ada working.
> 
> That sounds intresting!
> How much time would it take for a C&Ada programmer to get this mini AVR-Ada
> working?

Sorry, I don't know that, but here is a data point for anyone else who
would like to see gnat on AVR.  About two months ago I built a cross
gnat for AVR.  It appeared to generate correct code for a few simple
examples (I never got around to generate an actual executable).

-Erik
-- 
/d{def}def/m{mul}d/a{add}d/q{repeat}d/y 1 d 300{/x 1 d 600{/c x 600 div 4 m 2
sub d/z y 300 div 2 m 1 sub d/r 0 d/i 0 d/t 0 d{t 1 le{/n r r m i i m sub c a
d/b 2 r m i m z a d/r n d/i b d r r m i i m a 16 gt{exit}if} {exit}ifelse/t t 
.01 a d}loop t setgray x y moveto 1 1 rlineto stroke/x x 1 a d}q /y y 1 a d}q



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-21 14:40       ` Erik Johannessen
@ 2001-12-26 13:08         ` Karl Ran
  2002-01-08 18:34           ` Erik Johannessen
  2002-01-09 20:51           ` Florian Weimer
  0 siblings, 2 replies; 16+ messages in thread
From: Karl Ran @ 2001-12-26 13:08 UTC (permalink / raw)


>> That sounds intresting!
>> How much time would it take for a C&Ada programmer to get this mini
>> AVR-Ada working?

>Sorry, I don't know that, but here is a data point for anyone else who
>would like to see gnat on AVR.  

>About two months ago I built a cross gnat for AVR.  It appeared to
>generate correct code for a few simple examples (I never got around to
>generate an actual executable).

So, you just did something like:
gcc3.01: configure --language-ada --target-avr ??

Sounds too easy to me.
Stephen Leake mentioned 6 man-months (which is a bit too much for me)

Karl



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-26 13:08         ` Karl Ran
@ 2002-01-08 18:34           ` Erik Johannessen
  2002-01-10  0:31             ` Karl Ran
  2002-01-09 20:51           ` Florian Weimer
  1 sibling, 1 reply; 16+ messages in thread
From: Erik Johannessen @ 2002-01-08 18:34 UTC (permalink / raw)


karlran1234@yahoo.com (Karl Ran) writes:

> >About two months ago I built a cross gnat for AVR.  It appeared to
> >generate correct code for a few simple examples (I never got around to
> >generate an actual executable).
> 
> So, you just did something like:
> gcc3.01: configure --language-ada --target-avr ??

Yes, except that you need gcc from cvs (or a snapshot) and the
configure options are slightly different.

You also need a recent binutils and preferably avr-libc.

> Sounds too easy to me.
> Stephen Leake mentioned 6 man-months (which is a bit too much for me)

AFAICR this is the (estimated) time needed to port the runtime.

-Erik
-- 
/d{def}def/m{mul}d/a{add}d/q{repeat}d/y 1 d 300{/x 1 d 600{/c x 600 div 4 m 2
sub d/z y 300 div 2 m 1 sub d/r 0 d/i 0 d/t 0 d{t 1 le{/n r r m i i m sub c a
d/b 2 r m i m z a d/r n d/i b d r r m i i m a 16 gt{exit}if} {exit}ifelse/t t 
.01 a d}loop t setgray x y moveto 1 1 rlineto stroke/x x 1 a d}q /y y 1 a d}q



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2001-12-26 13:08         ` Karl Ran
  2002-01-08 18:34           ` Erik Johannessen
@ 2002-01-09 20:51           ` Florian Weimer
  2002-01-09 21:41             ` Michael Bode
  1 sibling, 1 reply; 16+ messages in thread
From: Florian Weimer @ 2002-01-09 20:51 UTC (permalink / raw)


karlran1234@yahoo.com (Karl Ran) writes:

> So, you just did something like:
> gcc3.01: configure --language-ada --target-avr ??

Please have a look at the build instructions, and keep in mind that
you have to use GCC 3.1 (i.e. the CVS HEAD branch).

> Stephen Leake mentioned 6 man-months (which is a bit too much for me)

The amount of work which is required depends partly on the
completeness of the Ada implementation you desire.  With the above
approach, you will only be able to compile very simple programs (if
your are lucky and the compiler works at all!).



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2002-01-09 20:51           ` Florian Weimer
@ 2002-01-09 21:41             ` Michael Bode
  2002-01-10 23:42               ` Georg Bauhaus
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Bode @ 2002-01-09 21:41 UTC (permalink / raw)


Florian Weimer <fw@deneb.enyo.de> writes:

> The amount of work which is required depends partly on the
> completeness of the Ada implementation you desire.  With the above
> approach, you will only be able to compile very simple programs (if
> your are lucky and the compiler works at all!).

It depends on what you call simple. The AVR itself is a simple device
the smaller models having only 256 bytes of RAM and 2k or 4k of
Flash. So you would probably not have the 50000+ lines of code
projects that Ada is good for. 



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2002-01-08 18:34           ` Erik Johannessen
@ 2002-01-10  0:31             ` Karl Ran
  0 siblings, 0 replies; 16+ messages in thread
From: Karl Ran @ 2002-01-10  0:31 UTC (permalink / raw)


>> So, you just did something like:
>> gcc3.01: configure --language-ada --target-avr ??

>Yes, except that you need gcc from cvs (or a snapshot) and the
>configure options are slightly different.


OK, I'll give it a try.

Thanks,
Karl



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2002-01-09 21:41             ` Michael Bode
@ 2002-01-10 23:42               ` Georg Bauhaus
  2002-01-12 15:11                 ` Michael Bode
  0 siblings, 1 reply; 16+ messages in thread
From: Georg Bauhaus @ 2002-01-10 23:42 UTC (permalink / raw)


Michael Bode <m.g.bode@web.de> wrote:
 
:  The AVR itself is a simple device
: the smaller models having only 256 bytes of RAM and 2k or 4k of
: Flash. So you would probably not have the 50000+ lines of code
: projects that Ada is good for. 

Uhm, do you want to imply that Ada is not good for 100+ lines 
projects?


Georg



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT and Atmel AVR Microcontrollers
  2002-01-10 23:42               ` Georg Bauhaus
@ 2002-01-12 15:11                 ` Michael Bode
  0 siblings, 0 replies; 16+ messages in thread
From: Michael Bode @ 2002-01-12 15:11 UTC (permalink / raw)


Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de> writes:

> Uhm, do you want to imply that Ada is not good for 100+ lines 
> projects?

Never. But for 100+ lines I can live with C or any other assembly
language. For larger projects I'd like to have something better.



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2002-01-12 15:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-09 21:13 GNAT and Atmel AVR Microcontrollers Michael Bode
2001-12-09 22:51 ` Florian Weimer
2001-12-10  6:27   ` Michael Bode
2001-12-10  9:12   ` Hans-Olof Danielsson
2001-12-10 16:19   ` Stephen Leake
2001-12-11 13:04     ` Karl Ran
2001-12-11 17:28       ` Stephen Leake
2001-12-12 20:13         ` Michael Bode
2001-12-21 14:40       ` Erik Johannessen
2001-12-26 13:08         ` Karl Ran
2002-01-08 18:34           ` Erik Johannessen
2002-01-10  0:31             ` Karl Ran
2002-01-09 20:51           ` Florian Weimer
2002-01-09 21:41             ` Michael Bode
2002-01-10 23:42               ` Georg Bauhaus
2002-01-12 15:11                 ` Michael Bode

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox