1

Trying to output 10 mhz pulses with Raspberry Pi/pi4j, wiringPi...

No problem with millisecond pulses

This works on Mac...doesn't work on Raspberry Pi with pi4j and wiringpi installed:

final long INTERVAL = 100;
        long start = System.nanoTime();
        long end=0;
        do{
            end = System.nanoTime();
        }while(start + INTERVAL >= end);
        System.out.println(end - start);
Grzegorz Smulko
  • 2,525
  • 1
  • 29
  • 42
sdvic
  • 11
  • 2
  • ??? Something more about this? Some explanation what you would like to achieve? – Krzysztof Cichocki Jun 18 '19 at 23:12
  • If your problem is that you can't get 0.1 µS resolution, see the [documentation for nanotime()](https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#nanoTime()), which says you get nanosecond precision but unspecified resolution. –  Jun 19 '19 at 00:15
  • On my Pi Zero, back-to-back calls to nanotime() give a difference of 6 to 8 µS ! The difference is always an integral number of µS (i.e., last 3 digits of difference in nS are 000) which suggests we have no better than µS resolution, –  Jun 19 '19 at 00:31
  • Thanks...I think that I was wrong and the code above was really working. Unspecified resolution is a reality! – sdvic Jun 20 '19 at 01:56

0 Answers0