crjeder / hx711_spi

This is a library for the hx711 chip. It uses SPI instead of bit banging for more reliability.
MIT License
14 stars 4 forks source link

Spi reader dont work for me :( #22

Open pronvis opened 1 month ago

pronvis commented 1 month ago

I wrote a test example for your library: https://github.com/pronvis/drawer-robot/blob/master/crates/companion/src/bin/hx711_spi_read.rs And it reads absolutely noise:

└─ hx711_spi_read::app::hx711_read @ src/bin/hx711_spi_read.rs:135
DEBUG #26: DYMH-06 data: -221.92485
└─ hx711_spi_read::app::hx711_read @ src/bin/hx711_spi_read.rs:135
DEBUG #31: DYMH-06 data: -0.000035274
└─ hx711_spi_read::app::hx711_read @ src/bin/hx711_spi_read.rs:135
DEBUG #35: DYMH-06 data: -221.92485
└─ hx711_spi_read::app::hx711_read @ src/bin/hx711_spi_read.rs:135
DEBUG #40: DYMH-06 data: -0.000035274
└─ hx711_spi_read::app::hx711_read @ src/bin/hx711_spi_read.rs:135
DEBUG #44: DYMH-06 data: 184.93732
└─ hx711_spi_read::app::hx711_read @ src/bin/hx711_spi_read.rs:135
DEBUG #49: DYMH-06 data: 258.91226

but non-spi reader that is used here: https://github.com/pronvis/drawer-robot/blob/master/crates/companion/src/bin/hx711_read.rs works fine. What could be wrong? All the difference in pin connections is: with spi:

PB13 <-> SCK
PB14 <-> DT

with non-spi:

PA7 <-> SCK
PA6 <-> DT
crjeder commented 1 month ago

Hmm. Strange. I need to look into this...