> > *The GPIO is high for about 1.5 Milliseconds. The usleep()-function is not > linear, so it did not work with any other value e.g. usleep(500). Sometimes > I decrease the value by one (1 microsecond) but the time decrease by 100 > microseconds.* > *Has anybody an idea what could be wrong? * >
First of all, usleep() is not your problem. The problem most likely is related to kernel latency. You could improve this by using a PREEMPT RT kernel, but that will only at best give you 95% determinism. Second, since you have not made your code public, we can not tell if servo.setValue() is well written or not. In the context of determinism. I will say however if you're not using mmap() with /dev/mem/ on the GPIO registers directly. Your code will be "slow", and not very deterministic. Lastly, if you need absolute determinism, you had better start using the PRUs . . . On Thu, Dec 3, 2015 at 4:30 AM, <andreas.bu...@hs-owl.de> wrote: > Hi, > > I am trying to control a servo with my BeagleBoneBlack using Angstrom. I > must have a high-level on a GPIO for 1 millisecond. I use the following > simple code: > > while(1){ > servo.setValue(BlackLib::low); > usleep(19000); > servo.setValue(BlackLib::high); > usleep(1000); > } > > The GPIO is high for about 1.5 Milliseconds. The usleep()-function is not > linear, so it did not work with any other value e.g. usleep(500). Sometimes > I decrease the value by one (1 microsecond) but the time decrease by 100 > microseconds. > Has anybody an idea what could be wrong? > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to beagleboard+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.