Closed kAdonis closed 5 years ago
Did you know the address of a BlinkM is configurable? https://thingm.com/fileadmin/thingm/downloads/BlinkM_datasheet.pdf
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.
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?
Answered my own question with https://community.particle.io/t/i2c-7-or-8-bit-addresses-fixed-pull-request-submitted/1328/9
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;
I dont know much about coding, i can´t help you there but the BlinkM works with 0x12 and does not with 0x09
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.
My pleasure!
@thinkyhead was it fixed?
@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
Hopefully this latest patch will take care of it!
Dont know, if it's a unicorn, but it is working. Thanks a lot
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.
Bug Report
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