Hi,
Problem statement: I am facing problem while reading registers over I2c, for CY8cmbr3116 cypress capsense controller.
Firmware details:
• ESP32 is configured as I2c master.
• Two devices are connected over I2c bus.
• Both are operating on 100Khz frequency.
ESP-IDF V3.3
I am using same i2c driver for port expander to read and write data over port.
I have verified slave address, for capsense controller and it is correct.
Could you please help me to resolve this.
ESP32 i2C support
-
- Posts: 118
- Joined: Tue Jun 26, 2018 3:09 am
Re: ESP32 i2C support
Hi, yashdave88
Can you provide more information about the I2C problem you are experiencing? Such as providing waveforms during communication.
thanks !!
Can you provide more information about the I2C problem you are experiencing? Such as providing waveforms during communication.
thanks !!
wookooho
-
- Posts: 9
- Joined: Fri Jan 31, 2020 6:52 am
Re: ESP32 i2C support
Hi
Kindly find attached screenshot of signal. Also find attached code we are using.
Kindly find attached screenshot of signal. Also find attached code we are using.
- Attachments
-
- i2c_example_main.c
- (14.33 KiB) Downloaded 462 times
-
- 20200219_163608.jpg (3.24 MiB) Viewed 7553 times
Re: ESP32 i2C support
We are supposed to guess? You have to show logs and error codes.I am facing problem
-
- Posts: 9
- Joined: Fri Jan 31, 2020 6:52 am
Re: ESP32 i2C support
HI,
We do not receive any error code
But our register read always fail.
Here with my logs
I (232) heap_init: Initializing. RAM available for dynamic allocation:
I (239) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (245) heap_init: At 3FFB2AA0 len 0002D560 (181 KiB): DRAM
I (252) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (258) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (264) heap_init: At 4008ADE4 len 0001521C (84 KiB): IRAM
I (271) cpu_start: Pro cpu start user code
I (288) spi_flash: detected chip: generic
I (289) spi_flash: flash io: dio
I (289) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
----Port expander init done----
----hardware reset init done----
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
kindly suggest.
We do not receive any error code
But our register read always fail.
Here with my logs
I (232) heap_init: Initializing. RAM available for dynamic allocation:
I (239) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (245) heap_init: At 3FFB2AA0 len 0002D560 (181 KiB): DRAM
I (252) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (258) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (264) heap_init: At 4008ADE4 len 0001521C (84 KiB): IRAM
I (271) cpu_start: Pro cpu start user code
I (288) spi_flash: detected chip: generic
I (289) spi_flash: flash io: dio
I (289) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
----Port expander init done----
----hardware reset init done----
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
----TASK[0] Task READ ----
f8 ff fd 3f 1f 51 6d fc d3 9c c2 f4 a9 d9 20 bc
ec 2f 23 9a
kindly suggest.
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 i2C support
How do you get that your register read always fails? From what I can see at a quick glance, that looks like mostly sane data to get from address 0xA0 in that chip.
-
- Posts: 9
- Joined: Fri Jan 31, 2020 6:52 am
Re: ESP32 i2C support
Hi,
kindly find attached code we are using.
Also find below log according to this code.
I (190) cpu_start: Project name: i2c-example
I (196) cpu_start: App version: v4.1-dev-1543-g431066f16-dirty
I (203) cpu_start: Compile time: Mar 2 2020 10:54:56
I (209) cpu_start: ELF file SHA256: 2d45717555bc47dc...
I (215) cpu_start: ESP-IDF: v4.1-dev-1543-g431066f16-dirty
I (222) cpu_start: Starting app cpu, entry point is 0x40081074
0x40081074: call_start_cpu1 at C:/msys32/home/vishakhak/esp/esp-idf/components/esp32/cpu_start.c:276
I (0) cpu_start: App cpu up.
I (232) heap_init: Initializing. RAM available for dynamic allocation:
I (239) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (245) heap_init: At 3FFB2AA0 len 0002D560 (181 KiB): DRAM
I (251) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (258) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (264) heap_init: At 4008ADE4 len 0001521C (84 KiB): IRAM
I (270) cpu_start: Pro cpu start user code
I (288) spi_flash: detected chip: generic
I (289) spi_flash: flash io: dio
I (289) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
----Port expander init done----
----hardware reset init done----
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
Let me know any change require in code to get proper data.
kindly find attached code we are using.
Also find below log according to this code.
I (190) cpu_start: Project name: i2c-example
I (196) cpu_start: App version: v4.1-dev-1543-g431066f16-dirty
I (203) cpu_start: Compile time: Mar 2 2020 10:54:56
I (209) cpu_start: ELF file SHA256: 2d45717555bc47dc...
I (215) cpu_start: ESP-IDF: v4.1-dev-1543-g431066f16-dirty
I (222) cpu_start: Starting app cpu, entry point is 0x40081074
0x40081074: call_start_cpu1 at C:/msys32/home/vishakhak/esp/esp-idf/components/esp32/cpu_start.c:276
I (0) cpu_start: App cpu up.
I (232) heap_init: Initializing. RAM available for dynamic allocation:
I (239) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (245) heap_init: At 3FFB2AA0 len 0002D560 (181 KiB): DRAM
I (251) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (258) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (264) heap_init: At 4008ADE4 len 0001521C (84 KiB): IRAM
I (270) cpu_start: Pro cpu start user code
I (288) spi_flash: detected chip: generic
I (289) spi_flash: flash io: dio
I (289) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
----Port expander init done----
----hardware reset init done----
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
----TASK[0] Task READ ----
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00
Let me know any change require in code to get proper data.
- Attachments
-
- i2c_example_main.c
- (14.39 KiB) Downloaded 463 times
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 i2C support
No, I'm not going to debug your code, especially if it's a hacked together example with remaining stuff commented out. Try some stuff yourself first: for instance, the I2C driver routines can return an error; how about actually checking if they do?
Who is online
Users browsing this forum: Baidu [Spider] and 444 guests