Recent

Author Topic: EpicTimer ARM  (Read 5972 times)

chrnobel

  • Sr. Member
  • ****
  • Posts: 261
EpicTimer ARM
« on: February 27, 2014, 02:30:29 pm »
Hi.

Does anyone know whether EpicTimer works on ARM processors, particularly Allwinner A10/20?

Or is there a replacement?

Thanks
Christian

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: EpicTimer ARM
« Reply #1 on: February 27, 2014, 02:42:09 pm »
I can test tonight [at work now] on my RPi if you want.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: EpicTimer ARM
« Reply #2 on: February 27, 2014, 03:06:43 pm »
I Assume you are asking about this. If so:
Quote
This component was designed for cross-platform applications...

But:
Quote
    Nanosecond resolution is supported on Intel Pentium versions with a Timestamp Counter.
    Microsecond system clock is the default timebase.

chrnobel

  • Sr. Member
  • ****
  • Posts: 261
Re: EpicTimer ARM
« Reply #3 on: February 27, 2014, 03:40:40 pm »
I can test tonight [at work now] on my RPi if you want.
No need Graeme, I just tried it my self on RPi, and it works.

But thank you anyway.

Christian

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: EpicTimer ARM
« Reply #4 on: February 27, 2014, 03:43:50 pm »
@ChrNobel: you might want to update the tested platforms list at
http://wiki.lazarus.freepascal.org/EpikTimer#Dependencies_.2F_System_Requirements
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

chrnobel

  • Sr. Member
  • ****
  • Posts: 261
Re: EpicTimer ARM
« Reply #5 on: February 27, 2014, 03:43:59 pm »
I Assume you are asking about this. If so:
Quote
This component was designed for cross-platform applications...
I have read the Wiki, but when it states cross-platform, it is to be understood OS.

It does not specify whether it works on other processor architectures than Intel or AMD (meaning x86), but from trying on the RPi it actually also works on ARM.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: EpicTimer ARM
« Reply #6 on: February 27, 2014, 03:46:43 pm »
Quote
I have read the Wiki, but when it states cross-platform, it is to be understood OS.
Well, that's your opinion ;)

I understand platform as the combination of hardware and OS. Even middleware etc depending on context.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

chrnobel

  • Sr. Member
  • ****
  • Posts: 261
Re: EpicTimer ARM
« Reply #7 on: February 27, 2014, 03:47:04 pm »
@ChrNobel: you might want to update the tested platforms list at
http://wiki.lazarus.freepascal.org/EpikTimer#Dependencies_.2F_System_Requirements
Yes, but will wait until I have done some further test to be assured that there are no hick-ups, just did at quick test with EpikTimers Test Application.

Also I will make some tests with Allwinner.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: EpicTimer ARM
« Reply #8 on: February 27, 2014, 03:47:52 pm »
Great, thanks!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

chrnobel

  • Sr. Member
  • ****
  • Posts: 261
Re: EpicTimer ARM
« Reply #9 on: February 27, 2014, 03:51:05 pm »
Quote
I have read the Wiki, but when it states cross-platform, it is to be understood OS.
Well, that's your opinion ;)

I understand platform as the combination of hardware and OS. Even middleware etc depending on context.
That might be a matter of words, but as there seems to be differences in the way that two relatively similar architectures (Intel and AMD x86) behaves with regards to read clockticks, I would be very precarious to use the phrase crossplatform without testing. 

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: EpicTimer ARM
« Reply #10 on: February 27, 2014, 03:56:50 pm »
I would be very precarious to use the phrase crossplatform without testing.
Of course.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: EpicTimer ARM
« Reply #11 on: February 27, 2014, 04:57:20 pm »
I have read the Wiki, but when it states cross-platform, it is to be understood OS.

It does not specify whether it works on other processor architectures than Intel or AMD (meaning x86), but from trying on the RPi it actually also works on ARM.
Let me quote the source code:

Quote
// These are here for architectures that don't have a precision hardware
// timing source. They'll return zeros for overhead values. The timers
// will work but there won't be any error compensation for long
// term accuracy.
{$ELSE} // add other architectures and hardware specific tick sources here
function HasHardwareCapabilityData: Boolean; begin Result:=False end;
function HasHardwareTickCounter: Boolean; begin Result:=false end;
function HardwareTicks:TickType; begin result:=0 end;
{$ENDIF}

The source code uses fpgettimeofday and fpnanosleep which I believe should work on ARM.

And finally:
Quote
// Return microsecond normalized time source for a given platform.
// This should be sync'able to an external time standard (via NTP, for example).
function SystemTicks: TickType;
{$IFDEF Windows}
...
{$ELSE}
var t : timeval;
begin
  fpgettimeofday(@t,nil);
   // Build a 64 bit microsecond tick from the seconds and microsecond longints
  Result := (TickType(t.tv_sec) * 1000000) + t.tv_usec;
{$ENDIF}
end;