Dead Hackers Society
Other BBSes »
 
 

68k Inside

Sommarhack 2024

Silly Venture 2024 SE
Demoscene  Coding  CT60  Buy/sell

CT60 and related things BBS
 
Re: CT60 weirdness
Posted by: sqward May,09.2014-17:53 

Thomas: I don't understand how you make your measurement. It seems to me that you have some sort of a loop in which you increase a variable? If so, this is not the best way to time things, because it will be dependent on your CPU speed.

I use the following routine to get time stamp accurate to about 20 microseconds. You can call it before and after the code you want to time and do the math.

uint64_t getMicroseconds( )
{
resync:
uint64_t timer200hz = *((volatile uint32_t*)0x4BA) ;
uint32_t data = *((volatile uint8_t*)0xFFFFFA23);

if ( *((volatile uint32_t*)0x4BA) != timer200hz )
{
goto resync;
}

timer200hz*=5000; // convert to microseconds
timer200hz+=(uint64_t)(((192-data)*6666)>>8); //26; // convert data to microseconds
return timer200hz;
}







[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
CT60 weirdness Thomas / New Beat May,09.2014-07:38
  Re: CT60 weirdness mikro May,09.2014-09:20
    Re: CT60 weirdness Thomas / New Beat May,09.2014-12:08
      Re: CT60 weirdness ggn May,09.2014-12:25
        Re: CT60 weirdness Thomas May,09.2014-17:58
      Re: CT60 weirdness sqward May,09.2014-17:53


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson