Other Parts Discussed in Thread: HALCOGEN
Hello,
I am development a library for "TLE493D-A2B6" but I could not run I2C I'm measuring with an oscilloscope, but the I2C and SDA lines never works, they always stay high
I've attached the code I wrote below.
static void i2cInitHal(void) { // I2C0 modülünü başlat i2cInit(); // I2C0 modülünü master modunda ayarla i2cSetMode(i2cREG1, I2C_MASTER); // I2C0 modülünün hızını 100kHz olarak ayarla i2cSetOwnAdd(i2cREG1, I2C_SLAVE_ADDRESS); i2cSetSlaveAdd(i2cREG1, I2C_SLAVE_ADDRESS); i2cSetBaudrate(i2cREG1, 100); } static void i2cSendData(uint8 *data, uint32 length) { // Veriyi I2C0 üzerinden gönder i2cSetDirection(i2cREG1, I2C_TRANSMITTER); i2cSetCount(i2cREG1, length); i2cSetMode(i2cREG1, I2C_MASTER); i2cSetStop(i2cREG1); i2cSetStart(i2cREG1); i2cSend(i2cREG1, length, data); while (i2cIsBusBusy(i2cREG1) == true) ; while (i2cIsStopDetected(i2cREG1) == 0) ; i2cClearSCD(i2cREG1); } static void i2cReceiveData(uint8 *data, uint32 length) { // Veriyi I2C0 üzerinden al i2cSetDirection(i2cREG1, I2C_RECEIVER); i2cSetCount(i2cREG1, length); i2cSetMode(i2cREG1, I2C_MASTER); i2cSetStart(i2cREG1); i2cReceive(i2cREG1, length, data); while (!i2cIsRxReady(i2cREG1)) ; i2cSetStop(i2cREG1); while (i2cIsStopDetected(i2cREG1) == 0) ; i2cClearSCD(i2cREG1); }
Code gets stuck in "while ((i2c->STR & (uint32)I2C_TX_INT) == 0U)" inside function "void i2cSend(i2cBASE_t *i2c, uint32 length, uint8 * data)"
And halcogen configuration
could you help me how i can solve the problem