| ??? 06/03/02 18:20 Read: times |
#23825 - Bye Assembly hello c |
I've been working on a very complex project for over 3 months now.
had 2 serial ports, one with hardware the other with software, used the 3 timers on the chip about 200 bytes of on chip ram and 20 bytes of onchip eeprom. used all I/O pins and made push button switches as keymatrix 15 switches alltogether. i have serial messages pumped in every 50 msec sharp which i have to monitor decode CRC check and take action.As well as discrete signals i/o. I had about 10 separate timers with software with resolution of 1 msec. made a pc interface to transfer timing parameters to the chip. I done all that with keil c and on a 12 clock cycles per instruction 24 Mhz Atmel chip, to my surprise i almost got 1 to 2 assembly line for each c line, sometimes more. The shocking news is that when I measured the timing loop of my program (which i needed to keep below 1 msec) it worked out to be far below 100 useconds) which gets interrupted by 50 msec serial interrupt. and only used 3.5 K of the 8k flash memory of the chip. After this experience I started questioning all those who say you should optimise your code with assembly. Maybe they dont trust or know the great new c compilers like keil. |



