Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast processor read() delay #46

Closed
palmerr23 opened this issue Mar 2, 2024 · 3 comments
Closed

Fast processor read() delay #46

palmerr23 opened this issue Mar 2, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@palmerr23
Copy link
Contributor

palmerr23 commented Mar 2, 2024

Thanks for the library, it works well!

To answer the question embedded in the code at line 135 in the cpp file, you do not need the delayMicroseconds(1) for a Pico running at 240MHz (PD_SCK is 500nS) in _shiftIn( ) or read( ).

The delay( ) treatment should probably be the same in both places.

It would be useful, however to have an option, as a Teensy 4 and other processors running at > 500MHz are likely to need them in both read( ) and _shiftIn( ).

  while (m > 0)
  {
    //  delayMicroSeconds(1) needed for fast processors?
    digitalWrite(_clockPin, HIGH);
    if(_fast_processor)
	delayMicroseconds(1);
    digitalWrite(_clockPin, LOW);
    if(_fast_processor)
	delayMicroseconds(1);
    m--;
  }

BTW, I tested the B input and it seems fine.

A pull request will be forthcoming.

I hope this is useful.

@RobTillaart RobTillaart self-assigned this Mar 2, 2024
@RobTillaart RobTillaart added the enhancement New feature or request label Mar 2, 2024
@RobTillaart
Copy link
Owner

Thanks for this feedback,
Definitely useful to hear.

@RobTillaart
Copy link
Owner

RobTillaart commented Mar 2, 2024

  • Merged the PR,
  • Will increase version ==> 0.4.0
  • will add the change to HX711_MP repo too ==> 0.2.0
  • updated build CI version
  • minor edits

@RobTillaart
Copy link
Owner

@palmerr23
HX711 & HX711_MP released
Again thanks for your addition / feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants