nimaltd / HX711

HX711 driver for STM32 HAL
GNU General Public License v3.0
75 stars 16 forks source link

Problem with HX711_delay_us #1

Open yoggi56 opened 3 years ago

yoggi56 commented 3 years ago

Hi! Thanks for your library :) It saved me a lot of time. I use stm32f446ze and found an issue with your function __STATIC_INLINE void HX711_delay_us(uint32_t microseconds) It worked only in the debug mode. I solved this issue initialised DWT:

__STATIC_INLINE void DWT_Init(void)
{
    CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; // allow to use counter
    DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;   // start counter
}

And of course it is needed to call this function in void HX711_init(void)

Dil-awaiz commented 3 years ago

Hi @yoggi56 , I was facing the same issue and solved it in a similar way, however there is another issue that I am facing regarding the calibration of my load cell. The load cell loses its calibration after few minutes of sitting idol i.e. the value of return data keeps creeping up. Can you kindly tell how did you actually calibrate your load cell using this library. It would be really helpful if you could share the code with me. Regards.

yoggi56 commented 3 years ago

I have the same issue with calibration so I'm trying to solve it. If you manage to solve this problem please send a code or link :)

pbui123 commented 1 year ago

I have the same issue too. Hope that you guys manage to solve this problem