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

Hi Olewolf #1

Open
hallard opened this issue Jul 14, 2015 · 0 comments
Open

Hi Olewolf #1

hallard opened this issue Jul 14, 2015 · 0 comments

Comments

@hallard
Copy link

hallard commented Jul 14, 2015

Thank you for sharing this lib, nice job.

I think there is a problem with the configuration_high_threshold and configuration_low_threshold, when you set a value to one of this registers, reading it back is not the value you set. As the value is 15 bits but left aligned, I think the method to set it should be more like this one (<<1 before setting the value)

void MAX31865_RTD::reconfigure( )
{
  uint16_t threshold ;
  /* Write the configuration to the MAX31865. */
  digitalWrite( this->cs_pin, LOW );
  SPI.transfer( 0x80 );
  SPI.transfer( this->configuration_control_bits );
  digitalWrite( this->cs_pin, HIGH );

  /* Write the threshold values. */
  digitalWrite( this->cs_pin, LOW );
  SPI.transfer( 0x83 );
  threshold = this->configuration_high_threshold << 1;
  SPI.transfer( ( threshold >> 8 ) & 0x00ff );
  SPI.transfer(   threshold        & 0x00ff );
  threshold = this->configuration_low_threshold << 1;
  SPI.transfer( ( threshold >> 8 ) & 0x00ff );
  SPI.transfer(   threshold        & 0x00ff );
  digitalWrite( this->cs_pin, HIGH );

}

Anyway, even with this fix it does not seem to work, I tested with PT1000 config with and without this PT1000 connected, I'm in the range when PT1000 is connected, and as soon I disconnect, I'm out of range, but status does not indicated a High threshold. Very strange. But it's by the end of the night here, so I need to take a rest, may be tomorrow I will see where's the problem ;-)

image

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

No branches or pull requests

1 participant