Re: What micros do you actually hate to work with?
- From: Joerg <notthisjoergsch@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 10 Oct 2006 20:45:45 GMT
Hello Ulf,
Have several complete C projects for customers that fit into an ATtiny13...
How many projects in C have you managed to put into 1k.
I am saying what I am saying, my try seems successfull enough.
The latest project (not functional) was totally written in assembly
language,
and after rewriuting it in C, I managed to reduce the code by 10%.
Writing in assembler is generally a waste of time on an AVR...
Ok, I have only used '51 family device from Atmel, don't know if there are 16-bitters in store anywhere. But your word "generally" urges me to ask you how this multiplication by 0.457358479 (Horner + CSD optimized) would be done in C on a uC without HW multiplier in less than 30 CPU clocks:
mov.w R12,R13
rra.w R13
rra.w R13
add.w R12, R13 ; X1=X*2^-2+X
rra.w R13
rra.w R13
add.w R12, R13 ; X2=X1*2^-2+X
rra.w R13
rra.w R13
rra.w R13
rra.w R13
add.w R12, R13 ; X3=X2*2^-4+X
rra.w R13
rra.w R13
add.w R12, R13 ; X4=X3*2^-2+X
rra.w R13
rra.w R13
sub.w R12,R13 ; X5=X4*2^-2-X
rra.w R13
rra.w R13
rra.w R13
add.w R12, R13 ; X6=X5*2^-3+X
rra.w R13 ; Final output=X6*2^-1
On an 8-bitter this would take a few more cycles but probably not more than another 10.
--
Regards, Joerg
http://www.analogconsultants.com
.
- Follow-Ups:
- Re: What micros do you actually hate to work with?
- From: Walter Banks
- Re: What micros do you actually hate to work with?
- From: David Brown
- Re: What micros do you actually hate to work with?
- From: Frank Bemelman
- Re: What micros do you actually hate to work with?
- From: Wilco Dijkstra
- Re: What micros do you actually hate to work with?
- References:
- What micros do you actually hate to work with?
- From: hsmith
- Re: What micros do you actually hate to work with?
- From: Vladimir Vassilevsky
- Re: What micros do you actually hate to work with?
- From: Roman
- Re: What micros do you actually hate to work with?
- From: steve
- Re: What micros do you actually hate to work with?
- From: Roman
- Re: What micros do you actually hate to work with?
- From: steve
- Re: What micros do you actually hate to work with?
- From: CBFalconer
- Re: What micros do you actually hate to work with?
- From: Didi
- Re: What micros do you actually hate to work with?
- From: PhilW
- Re: What micros do you actually hate to work with?
- From: Didi
- Re: What micros do you actually hate to work with?
- From: Ulf Samuelsson
- What micros do you actually hate to work with?
- Prev by Date: Re: What micros do you actually hate to work with?
- Next by Date: Re: What micros do you actually hate to work with?
- Previous by thread: Re: What micros do you actually hate to work with?
- Next by thread: Re: What micros do you actually hate to work with?
- Index(es):
Relevant Pages
|