On Friday 18 January 2008 13:28, Paulo Marques wrote:
[...]
> Say, one of the things I wanted to implement, was something like an
> include file with (just a rough sketch):
>
> #define COUNTER_CTRL_PORT  0x56
>
> static void avrtest_counter_start(byte counter)
> {
>   *((volatile unsigned char *) COUNTER_CTRL_PORT) = counter;
> }
>
> static void avrtest_counter_stop(byte counter)
> {
>   *((volatile unsigned char *) COUNTER_CTRL_PORT) = 0x80 | counter;
> }
[...]
> What I would like this interface to achieve:
>
> - be able to start / stop the counters without affecting cycle counts

You can allocate COUNTER_CTRL_PORT at low part of port's addresses
with limitation of counters number to 8. So, SBI/CBI instruction
would be used (exclude -O0), that is simple to compensate.

Note, that avrtest is not too accurate in clocks counting, for
example, MOVW adds 2 clocks, ADIW/SBIW adds 0 clocks.

[...]
> Since you seem to frequently produce cycle counts for your floating
> point operations and other libc functions, what would you like this
> interface to be able to do?

I use a subtraction of 2 passes: with target and dummy functions.

Regards,
Dmitry.



_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to