找回密码
 立即注册

微信扫码登录

查看: 525|回复: 6

I2C does not work

[复制链接]

8

主题

19

回帖

210

积分

华贵铂金

积分
210
发表于 2025-4-10 04:03:43 | 显示全部楼层 |阅读模式 来自 俄罗斯
information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: TLSR8258
SDK及版本: zigbee sdk V3.7.1.2_Patch_0001(PR)
Hello.


i2c does not work. If there is no slave device in the circuit, then there are normal signals on SDA and SCL. But if you connect any slave device, then there are the same signals on the buses, as if they are shorted. Slave devices are 100% working, tested on another microcontroller.



#define I2C_PIN_GROUP       I2C_GPIO_GROUP_C2C3
#define I2C_CLOCK           200000//200K




    drv_i2c_gpio_set(I2C_PIN_GROUP);
    drv_i2c_master_init(I2C_CLOCK);





    /* BME280_I2CADDR - 0x76, reg - 0xD0 */
    drv_i2c_read_series(BME280_I2CADDR << 1, reg, 1, readBuffer, 1);



Without slave device.
sharex-22-42-20-613.jpg

With slave device
sharex-19-14-50-262.jpg

8

主题

19

回帖

210

积分

华贵铂金

积分
210
 楼主| 发表于 2025-4-11 02:12:10 | 显示全部楼层 来自 俄罗斯
I found the reason. The circuit board was faulty.

8

主题

19

回帖

210

积分

华贵铂金

积分
210
 楼主| 发表于 2025-4-11 06:02:37 | 显示全部楼层 来自 俄罗斯
Ok.

How to get error code from `drv_i2c_write_series()` and `drv_i2c_read_series()`?

27

主题

297

回帖

937

积分

版主

积分
937
发表于 2025-4-11 15:32:29 | 显示全部楼层 来自 上海
Do you mean the error code refers to the reason for writing or reading failure? This doesn't seem to be obtainable.

8

主题

19

回帖

210

积分

华贵铂金

积分
210
 楼主| 发表于 2025-4-26 22:35:07 | 显示全部楼层 来自 俄罗斯
TL_YB 发表于 2025-4-11 15:32
Do you mean the error code refers to the reason for writing or reading failure? This doesn't seem to ...

This is how it can be done. Always returns 0 on success.

int8_t bh1750_i2c_write(const uint8_t *data, uint32_t len, bh1750_dev_t *dev) {

    drv_i2c_write_series(dev->addr, 0, 0, (uint8_t*)data, len);

    return (reg_i2c_status & FLD_I2C_NAK);
}


27

主题

297

回帖

937

积分

版主

积分
937
发表于 2025-4-30 16:28:32 | 显示全部楼层 来自 上海
Hi, I have confirmed from the designer that 8258 does not support NACK check mode.

8

主题

19

回帖

210

积分

华贵铂金

积分
210
 楼主| 发表于 2025-5-2 23:13:11 | 显示全部楼层 来自 俄罗斯
TL_YB 发表于 2025-4-30 16:28
Hi, I have confirmed from the designer that 8258 does not support NACK check mode.

Everything works fine with TLSR8258. If there is no device, this code returns 4. If successful, it returns 0.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-6-7 00:50 , Processed in 0.104275 second(s), 24 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表