In my project I need to interface HX711 24 bit External ADC to STM32L100RC6 MCU How can I do this ?
I've used this IC in several designs. It's quite simple, but a bit ad hoc: you connect DOUT and PD_SCK to 2 GPIOs of your MCU. Data comes out on DOUT when you clock PD_SCK , so you can think of it as SPI without MOSI. You don't send instructions to the HX711, you just pulse its PD_SCK to read the next measurement.
- To read a value, you must wait for DOUT to be LOW. Then, clock PD_SCK with 24 positive-going pulses.
- To set the internal differential amplifier's gain (128, 64, 32), you add extra pulses at the end for a total of 25, 26 and 27 pulses respectively. This is applied to the next acquisition, so you should do a dummy read in the beginning to set the initial gain.
- DOUT is a 24-bit value with bits valid on PD_SCK falling edges.
It's really all there is to it.
Here's a capture I did recently in gain=128 mode (25 pulses).
It is a single acquisition part of a train of samples. I was experimenting with taking multiple samples and averaging them to reduce noise. The events on the right are the times at which the samples were measured. It's not constant because I was doing something like 6 acquisitions per measurement, at roughly 10Hz.
Below, a capture of the overall acquisition over a longer period of time. Each yellow glitch is a full sequence as the one shown in the first image. You can see I'm doing 1 measurement per second, where each measurement consists of 6 samples as 10Hz. This was just for testing the chip and my asynchronous acquisition interface in the firmware.