avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] New demo: asmdemo


From: Joerg Wunsch
Subject: [avr-libc-dev] New demo: asmdemo
Date: Tue, 29 Aug 2006 22:01:37 +0200
User-agent: Mutt/1.5.11

Those of you who are subscribed to avr-libc-commit have already
noticed: I just committed a new example project to CVS.  It's named
"asmdemo", and its primary purpose is to demonstrate how to connect C
and assembly source files in a single project.

The idea of that demo has been inspired by a real-life problem of some
user on the (German-language) GCC forum on
http://www.mikrocontroller.net , it's a PWM detector for a typical
RC-model style PWM signal.  As the original author intented to use a
cheap ATtiny13 controller, he suffered from the AVR only offering one
timer channel, so the same timer had to be used to detect the incoming
PWM pulse train, as well as to generate the outgoing (standard) PWM
signal.  Given the limited resources of an ATtiny13, that job became
quite tricky, so I eventually thought it to be a good example for why
one might want to resort to some assembly-language parts within a
project.

Funnily enough, as a proof of concept for my test setup to verify the
entire example, I ended up writing an initial implementation using an
ATtiny45, entirely written in C.  This AVR has more resources
available for the job (in particular a second timer channel), so the
implementation was straightforward.  I then tailored the ATtiny13
solution to provide the same functionality.  For comparision purposes,
I left the ATtiny45 implementation around as well.  It can serve as an
example to the user that with only a few more cents spent into the
device, often your job can become way easier (and "time to market"
will be shortened), so the decision whether to really use a combined
assembly/C solution will pay out or not.  (Once the ATtiny25 is
available, the price difference will be even smaller.)

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]