Thanks Dennis ...!!! 1 ) Yes, I am avoiding to use < sysfs >. Now I am not using it for my purpose. 2 ) Now I have written program using mmap() where I am maintaining necessary time delay which is required by HX711 sensor given into Datasheet. I am also attaching that program to analyze.
Github Link ------------------- https://github.com/viveky1794/BBB-Learning/blob/fromOffice/BBB-WorkSpace/Sensors/ADC-HX711/HX711-17-03-21/gpi.c This time I am getting data but I doubt that it is not correct because reading is not stable. --------- Vivek Yadav On Tue, Mar 16, 2021 at 8:59 PM Dennis Lee Bieber <[email protected]> wrote: > On Sun, 14 Mar 2021 04:08:20 -0700 (PDT), in > gmane.comp.hardware.beagleboard.user Vivek Yadav > <[email protected]> wrote: > > > >I have set the direction of these 2 pins after going under > >/sys/class/gpio/gpioxx/direction as OUT and IN as per requirements. > >But I am not able to get data from HX711. So I debug and Find out that I > am > >taking one time than required. Typically my SCK pin must remain high1-2 > >mico Seconds but I am taking 5-6 mico Seconds. Which is not desirable. > *All > >this Code is in C language.* > > > > The first thing to understand is that the BBB is not a > microcontroller > with deterministic timing (the PRU modules, however, ARE microcontrollers). > The documentation for that chip assumes a microcontroller. > > You are going through the LINUX file system to access kernel > modules > for GPIO. LINUX is not real-time. Essentually, each time you issue a set > (write) or read of a GPIO, your process is suspended, while the OS > schedules your I/O. If there are other processes suspended, of equal > priority, one of them may be woken up next. > > The actual read-back of a sample is close to the SPI protocol, but > the > odd timings needed for configuring the chip are not... > > >Now I need Your suggestions that How can I speed up my GPIO pin reading > and > >Writing Time. > > > > Avoid the sysfs calls if possible (you don't show your code so it > is > difficult to make suggestions). Write a driver using the PRU, and an > interface to the application running on Linux (remoteproc/rpmsg). > > >I have seen some example where writers trying to Show the GPIO > >configuration. using mmap(). But no one talking about the GPIO speed. > > > > mmap() is bypassing the sysfs kernel calls by running as a > privileged > process with direct access to the processor registers controlling GPIO. > > > -- > Dennis L Bieber > > -- > 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/51j15gp5gv1490cvi22pv4cnso66vmk70a%404ax.com > . > -- 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/CABPSWR6ju0iWqwdsBfMGBcp1EOLY-DUGb%2Bn_w5kAa-_CtcPHsg%40mail.gmail.com.
