Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Best approach to interface HX711 with Nordic nrf52832?

I am working with HX711 and I am trying to interface with nrf52832. Should I proceed with SAADC example or UART or Twi Sensor

  • Good afternoon. I am totally new to programming with controllers ARM Cortex M-4 and I need to do to operate the ADC HX711 in a Nrf52DK without the use of Ble. I have searched to the best of examples for the forums and I have not solved my needs. I can only find examples of Main c. for use with Ble. Someone could help me to build the file Main c. to be able to read the HX711 through NRF_LOG_INFO? I appreciate deeply the help.
  • I have a separate solution to this problem that's preferable in a few ways:

    • Only one timer instance is needed, instead of 2
    • The processing is done in interrupts, so you don't need to wait while polling
    • There are no more corrupt samples

    The main realization behind it is that the hx711 will shut down if the clock line is held high for too long. When a high priority interrupt (from soft device, for example) arrives it can cause a delay which leaves the clock high and causes the hx711 to shut down. What my solution does is to use a timer / PPI to turn the clock on, then off, then calls an interrupt which can read the data and resume the timer. If an interrupt arrives and adds latency, this extra time occurs with the clock low, which is allowed for arbitrary lengths of time.

    You can find the code: here

    Suggestions for improvements are always welcome!

Related