i2cscanner single device, multiple device addresses
STM32F103ZET6STM32F103ZET6Microcontrollers and processors… Wed Jan 24, 2018 8:46 pm Hi everybody i’m trying to compile the code on a Open103Z ( STM32F103ZET ) very close of 103RET but i’ve an issue during compilation : sketch\src\HAL\HAL…View in hardware catalog Minimum System Development Board ARM STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog Cortex-M3Cortex-M3Microcontrollers and processors…get this error arm-none-eabi-g++: error: unrecognized command line option '-CC -mcpu= cortex-m3 ' RogerClark Sun May 15, 2016 6:25 am Fixed it @vassilis do a pull from my repo to…View in hardware catalog M75
from
http://www.ebay.co.uk/itm/291305557264? … EBIDX%3AIT
i2c scanner(from examples) shows this
Scanning…
I2C device found at address 0x50
I2C device found at address 0x51
I2C device found at address 0x52
I2C device found at address 0x53
done
the device address is known to be 0x50, so is this just bad address decoding or is it really returning 4 devices?
i’m inclined to the former:-)
the data sheet says single address and im trying to write and then read back from a location; mention is made of
a ‘repeated start.
so my code
int data;
#define Trigger PB3void setup() {
pinMode(Trigger, OUTPUT);
digitalWrite(Trigger, LOW);
Serial.begin(115200);
Wire.begin();
}
void loop() {
digitalWrite(Trigger, HIGH); // ols trigger
Wire.i2c_start();
Wire.i2c_shift_out(0x50); // device address
Wire.i2c_get_ack();
Wire.i2c_shift_out(0x5a); // writing data to this address
Wire.i2c_get_ack();
Wire.i2c_shift_out(0xa5); // write data
Wire.i2c_get_ack();
Wire.i2c_stop();
delay(5);
Wire.i2c_start();
Wire.i2c_shift_out(0x50); // device address
Wire.i2c_get_ack();
Wire.i2c_shift_out(0x5a); // writing data to this address
Wire.i2c_get_ack();
data = Wire.i2c_shift_in(); // write data
Wire.i2c_get_ack();
Wire.i2c_stop();
digitalWrite(Trigger, LOW); //
delay(5);
}