Michael, Thanks!! At least you have confirmed 3us, so my guess of
7us for an average amforth word is not so bad (:-)). I am using rtc
as well, however for these time measurements I use ticker (you may
see it somewhere in the post). I am thinking now to use 16bit
counter for the hw timer1 clocked by f_cpu and I will read its value
as well the info from timer variable (incremented by timer1
overflow). So I may get sub usec resoulution. However, the ticker
will make the measured time longer by ticker handling, you are
right.
I am using 30000 do-loop for those measurements so it is ok, I
guess. The resolution of my timer is 10ms (one shot).
But there is other Q I would like address - how to measure a word
duration? Imagine to measure f/. So the loop might be:

30000 0  do _pi _pi   f/    fdrop loop .... 
or
30000 0 _pi _pi do fdup fdup   f/   fdrop loop ...

the empty loop:

30000 0 _pi _pi do fdup fdup  fdrop  fdrop loop ...
or
30000 0 _pi _pi do    loop... Which one. So to measure you need to
know the duration of other words as well..
Simply how to isolate f/ as much as possible? The other possibility
is to fill the f/ and empty it directly in asm,, or simply run
everything in simulator. I've measured the f/ (735 cycles) and f*
(190) in simulator with real data, but not keen do it with every
word (:-))).  Pito







> So I have 3 / 0.05 = 60 cycles for 'one word'.
> 
> So where does amforth spend 24 more cycles? That
> is at an average the  
> overhead caused by my ISR time ticker of RTC, I
> guess.
> 
> To see a word "as is" connect an oscilloscope to a
> port pin. let an  
> empty loop toggle your port pin. Than add your
> word to the loop an  
> run again.
> In the resulting frequency difference you get the
> execution time of  
> your word.
> 
> Michael
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> > Start uncovering the many advantages of virtual
> appliances
> and start using them to simplify application
> deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Amforth-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/amforth-devel



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Amforth-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to