Hi Walter, I don't think you need an RTC for relative time. clock_gettime should do the job (https://linux.die.net/man/3/clock_gettime) There are also more intuitive ways to manipulate timespec structs in the RCL (http://strawsondesign.com/docs/librobotcontrol/group__time.html).
Best, Michele On Wed, Feb 17, 2021 at 6:25 PM Walter Cromer <[email protected]> wrote: > I really don't need ns. The valve 'on time' is going to be in the range > of 500 ms to 2 seconds probably. > > I will review the PRUCookbook! Thanks! > > Walter > On Wednesday, February 17, 2021 at 10:10:53 AM UTC-5 Mark A. Yoder wrote: > >> The PRUs can give you 10's of ns timing, which is more than good enough >> for milliseconds, but might be over kill. >> >> I'd think using C on the ARM processor should be fast enough. I'd use >> gpiod[1]. >> >> If you really want the ns timing of the PRUs, check out the PRU >> Cookbook[2] >> >> --Mark >> >> [1] https://github.com/starnight/libgpiod-example >> [2] https://github.com/MarkAYoder/PRUCookbook >> >> On Tuesday, February 16, 2021 at 10:51:11 AM UTC-5 [email protected] >> wrote: >> >>> Depending on how precise you need to be, I would go for the PRU-ICSS. >>> They can control the GPIOs pretty easily. >>> >>> Le mardi 16 février 2021 à 10:03:47 UTC-5, [email protected] a >>> écrit : >>> >>>> I have a BBB Wireless running Linux beaglebone 4.14.108-ti-r106 #1 SMP >>>> PREEMPT Fri May 24 22:12:34 UTC 2019 armv7l GNU/Linux >>>> >>>> I am writing in C. >>>> >>>> I turn a valve on and then need to read some sensors for N milliseconds >>>> and then turn the valve off. >>>> >>>> What's the best way to read milliseconds on the BBBw? I don't have a >>>> RTC on this particular unit but could add one using I2C. I have an >>>> Adafruit 4282 with a DS3231 RTC on it on another BBBw that I could use >>>> temporarily to prove it works. What other options are available? >>>> >>>> >>>> -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beagleboard/fc16c0ce-4895-4bfd-93a4-245fe6b0d59cn%40googlegroups.com > <https://groups.google.com/d/msgid/beagleboard/fc16c0ce-4895-4bfd-93a4-245fe6b0d59cn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CANC2S_F6SN3Bz05U6pwrD6LA8DFkDOBGbLbpah%3D%2B%3DH6bChfo6g%40mail.gmail.com.
