EpicTimer ARM lazarus / 32-Linux ---------------------------------------------------------------------- chrnobel · 2014-02-27 13:30 Hi. Does anyone know whether EpicTimer works on ARM processors, particularly Allwinner A10/20? Or is there a replacement? Thanks Christian ---------------------------------------------------------------------- Graeme · 2014-02-27 13:42 I can test tonight [at work now] on my RPi if you want. ---------------------------------------------------------------------- engkin · 2014-02-27 14:06 I Assume you are asking about this. If so: QuoteThis 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 · 2014-02-27 14:40 Quote from: Graeme Geldenhuys on February 27, 2014, 02:42:09 pmI 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 · 2014-02-27 14:43 @ChrNobel: you might want to update the tested platforms list at http://wiki.lazarus.freepascal.org/EpikTimer#Dependencies_.2F_System_R equirements ---------------------------------------------------------------------- chrnobel · 2014-02-27 14:43 Quote from: engkin on February 27, 2014, 03:06:43 pmI Assume you are asking about this. If so: QuoteThis 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 · 2014-02-27 14:46 QuoteI 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. ---------------------------------------------------------------------- chrnobel · 2014-02-27 14:47 Quote from: BigChimp 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_R equirements 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 · 2014-02-27 14:47 Great, thanks! ---------------------------------------------------------------------- chrnobel · 2014-02-27 14:51 Quote from: BigChimp on February 27, 2014, 03:46:43 pmQuoteI 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 · 2014-02-27 14:56 Quote from: chrnobel on February 27, 2014, 03:51:05 pmI would be very precarious to use the phrase crossplatform without testing. Of course. ---------------------------------------------------------------------- engkin · 2014-02-27 15:57 Quote from: chrnobel on February 27, 2014, 03:43:59 pmI 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;