From: Grant Edwards on
On 2008-04-22, Lax <Lax.Clarke(a)gmail.com> wrote:

> Are there any situations where programming an embedded
> processor "requires" at least some assembly code?

Usually.

> How about for AVR, MSP430, 68HC11, 8051(Atmel)?

Yes.

> Can these 4 microcontrollers be programmed fully in C without
> touching assembly (even interrupts and etc.)?

Sometimes. It depends on the toolchain and on the job to be
done. Most toolchains provide C extensions to do things like
interrupts and access special hardware features. If those
extensions are sufficient for what you need to do, then you
don't need to write assembly code. If they aren't, then you do.

--
Grant Edwards grante Yow! ... or were you
at driving the PONTIAC that
visi.com HONKED at me in MIAMI last
Tuesday?
From: Bill Leary on
"Lax" <Lax.Clarke(a)gmail.com> wrote in message
news:2defcf6d-7dab-4699-9ce1-d433240398e4(a)m36g2000hse.googlegroups.com...
> Are there any situations where programming an embedded processor
> "requires" at least some assembly code?

In every case where I've worked an embedded processor directly, I've had to
at least initialize the environment so it could run C. Basically, setup the
stack, clear RAM and jump to _main.

In cases where there's an OS on it already, and that has an applications
hook, then it could have been done with only C. In some cases, however,
it's been expedient to use some assembler.

> How about for AVR, MSP430, 68HC11, 8051(Atmel)?
> Can these 4 microcontrollers be programmed fully in C without touching
> assembly (even interrupts and etc.)?

I have no experience with the first two. For the last two, without an OS,
yes. With an OS, for the 68HC11 I did for expediency, but could have
avoided it, but for the 8051 I had to do some assembly. Perhaps selection
of a different OS or development package would have made it possible to
avoid assembler.

- Bill

From: linnix on
On Apr 22, 9:51 am, "Bill Leary" <Bill_Le...(a)msn.com> wrote:
> "Lax" <Lax.Cla...(a)gmail.com> wrote in message
>
> news:2defcf6d-7dab-4699-9ce1-d433240398e4(a)m36g2000hse.googlegroups.com...
>
> > Are there any situations where programming an embedded processor
> > "requires" at least some assembly code?
>
> In every case where I've worked an embedded processor directly, I've had to
> at least initialize the environment so it could run C. Basically, setup the
> stack, clear RAM and jump to _main.

There are always assembly involved somewhere, but you don't have to
write them. Why are you re-inventing run-time libraries?

>
> In cases where there's an OS on it already, and that has an applications
> hook, then it could have been done with only C. In some cases, however,
> it's been expedient to use some assembler.
>
> > How about for AVR, MSP430, 68HC11, 8051(Atmel)?
> > Can these 4 microcontrollers be programmed fully in C without touching
> > assembly (even interrupts and etc.)?

Yes for AVR, you can interrupt, sleep, powerdown and change clock
speeds in C. The only assembly I have used is to load flash codes
into data space, for which there is no C equivalent.

>
> I have no experience with the first two. For the last two, without an OS,
> yes. With an OS, for the 68HC11 I did for expediency, but could have
> avoided it, but for the 8051 I had to do some assembly. Perhaps selection
> of a different OS or development package would have made it possible to
> avoid assembler.
>
> - Bill

From: Walter Banks on


Vladimir Vassilevsky wrote:

> You have to resort to assembly in the two special cases:
>
> 1. The system level work like switching the contexts of the tasks, C
> startup code, etc.
>
> 2. The parts of code where the performance is very critical.
>
> Other then that, everything can be done in C.

Vladimir,

In your second point I would qualify it to parts of code
requiring exact timing on anything that we have released
recently that seems to be the only limitation.

Regards,

--
Walter Banks
Byte Craft Limited
Tel. (519) 888-6911
http://www.bytecraft.com
walter(a)bytecraft.com






From: Grant Edwards on
On 2008-04-22, Bill Leary <Bill_Leary(a)msn.com> wrote:
> "Lax" <Lax.Clarke(a)gmail.com> wrote in message
> news:2defcf6d-7dab-4699-9ce1-d433240398e4(a)m36g2000hse.googlegroups.com...
>> Are there any situations where programming an embedded processor
>> "requires" at least some assembly code?
>
> In every case where I've worked an embedded processor directly, I've had to
> at least initialize the environment so it could run C. Basically, setup the
> stack, clear RAM and jump to _main.

For processors without an external bus (IOW they have a fixed
memory map), many toolchains will provide startup code that
does all that. That's certainly true for GCC on the Atmel AVR
and TI MSP430: tell the compiler which part you're using, and
you don't have to write a lick of startup code.

--
Grant Edwards grante Yow! Did something bad
at happen or am I in a
visi.com drive-in movie??