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

[bugfix_2.0.x] LPC1768 BlinkM wrong I2C- Address #9799

Closed
kAdonis opened this issue Feb 25, 2018 · 13 comments
Closed

[bugfix_2.0.x] LPC1768 BlinkM wrong I2C- Address #9799

kAdonis opened this issue Feb 25, 2018 · 13 comments
Labels
T: Question Questions, generally redirected to other groups.

Comments

@kAdonis
Copy link
Contributor

kAdonis commented Feb 25, 2018

Bug Report

  • Description: BlinkM not responding to M150 B255
  • Expected behaviour: BlinkM lights up blue

When I change i2C- Address in blinkm.cpp to 0x12 BlinkM is doing fine.

Wire.beginTransmission(0x12)

So it seems to me, there is a Problem with 7 bit I2C- Adresses (like BlinkM with 0x09) wich are left shifted as stated in BlinkM Datasheet.
Just changing the Address to 0x12 breaks compatibility with Arduino, so I think it has to be done in the Hal, which is far beyond my skills

@thinkyhead
Copy link
Member

thinkyhead commented Feb 25, 2018

Did you know the address of a BlinkM is configurable? https://thingm.com/fileadmin/thingm/downloads/BlinkM_datasheet.pdf

@thinkyhead thinkyhead added the T: Question Questions, generally redirected to other groups. label Feb 25, 2018
@kAdonis
Copy link
Contributor Author

kAdonis commented Feb 25, 2018

Yes, I know that. But thats not the Point
The default Address 0x09 works with the Arduino mega, but with a ReArm and probably with the STMs its getting 0x12, because the 7bit Address ist left shifted.
this will affect all 7 bit Adresses on the I2C bus.

@thinkyhead
Copy link
Member

thinkyhead commented Feb 25, 2018

Ah, right. My hex math isn't working today. Thanks for clarifying.

So, you said if you give it 0x12 it works fine. That implies that we should be shifting all our addresses left, so that the BlinkM will see the 0x09 it wants, correct?

Or is it the converse, where our usual 0x09 is being left-shifted on the way out, so that the BlinkM internally gets the 0x12 that it wants, but for STM and others we must do the left shift on its behalf?

@thinkyhead
Copy link
Member

@thinkyhead
Copy link
Member

thinkyhead commented Feb 25, 2018

Our LPC HAL includes this… The address is being right-shifted before send. So it's expecting the left-justified address. Of course, we have control over this one.

uint8_t TwoWire::endTransmission(void) {
  // transmit buffer (blocking)
  I2C_M_SETUP_Type transferMCfg;
  transferMCfg.sl_addr7bit = txAddress >> 1; // not sure about the right shift
	transferMCfg.tx_data = txBuffer;

@kAdonis
Copy link
Contributor Author

kAdonis commented Feb 25, 2018

I dont know much about coding, i can´t help you there
but the BlinkM works with 0x12 and does not with 0x09

@thinkyhead
Copy link
Member

Well it's important that I state these things, because the core HAL developers will be reading this too. Thank you immensely for bringing this to our attention! Should be fixed later today.

@kAdonis
Copy link
Contributor Author

kAdonis commented Feb 25, 2018

My pleasure!

@boelle
Copy link
Contributor

boelle commented Feb 20, 2019

@thinkyhead was it fixed?

@kAdonis
Copy link
Contributor Author

kAdonis commented Feb 20, 2019

@thinkyhead @boelle Sorry, this was not fixed. I know, it has a low priority and maybe I am the only one still using a BlinkM, but I still need to change I2C adress every time I download marlin

thinkyhead added a commit that referenced this issue Feb 20, 2019
Fix #9799 — hopefully not a unicorn
@thinkyhead
Copy link
Member

Hopefully this latest patch will take care of it!

@kAdonis
Copy link
Contributor Author

kAdonis commented Feb 20, 2019

Dont know, if it's a unicorn, but it is working. Thanks a lot

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: Question Questions, generally redirected to other groups.
Projects
None yet
Development

No branches or pull requests

3 participants