Just found out, that my timing wasn't chosen that well. Was wondering about the SCL signal, that had the shape of a PWM with 70% duty cycle (beeing low 70% of the time). Now that I used the ST I2C config tool again, it spit out this timing value:
Code: Select all
0x00901D2BUsing this value I have a nicely shaped clock signal with a 50% duty cycle
Now, I tried to send out the same command bytes to four of my slaves in a row using a for loop. Unfortunately when commenting out the sleep command it would just stop after one command has been send out to the first slave and the first byte (which is the slave address) has been put on the lines. Then, stop condition, nothing happens furthermore.
Including any kind of delay in between heals the situation... Would like to know the cause.
Code: Select all
static uint8_t addr[] = {0xC0, 0xC2, 0xC4, 0xC6};
static uint8_t txBuf[8] = {0x89, 0xFF, 0xFF, 0xE2, 0xF1, 0x02, 0x00, 0x0C};
...
i2cAcquireBus(&I2CD1);
int i;
for(i=0; i<4; i++){
i2cMasterTransmitTimeout(&I2CD1, addr[i]>>1, txBuf, 8, rxBuf, 0, TIME_INFINITE);
chThdSleepMicroseconds(1);
}
i2cReleaseBus(&I2CD1);
Cheers