0
\$\begingroup\$

I want to use 3 I2C peripherals connected to this WFI32E01PC. This part has 2 options. Either MCU or the 54-pin package WFI32 module. I plan to use the 54-pin module.

But on page 3 of the datasheet, Table 2, this module seems to have only 1 I2C peripheral. But I require 3. In that case, I read there is an option called bit-banging. Can it be implemented on this module to interface the remaining two i2c peripherals to the GPIO pins of this module?

Also, does this module support a standard JTAG interface or SWD interface for programming?

I checked this user guide of this WFI32 Eval board, but the debugging section on page 8, doesn't confirm that we can use a standard JTAG or SWD interface.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ The first question is why do you need, or think you need, 3 separate I2C modules, instead of one? \$\endgroup\$
    – Justme
    Commented Jun 13, 2023 at 11:57
  • 1
    \$\begingroup\$ "I require 3" can you elaborate on your reasoning? This seems an xy problem, to me at least... \$\endgroup\$ Commented Jun 13, 2023 at 11:57
  • \$\begingroup\$ Why do you need 3 I2C? There are I2C expanders and multiplexes that allow you to use multiple instances of the same device. Please provide more details. \$\endgroup\$
    – Lior Bilia
    Commented Jun 13, 2023 at 11:57
  • \$\begingroup\$ In the span of < 10 seconds three different people asked the same thing :D \$\endgroup\$ Commented Jun 13, 2023 at 11:57
  • 1
    \$\begingroup\$ For the benifit of the OP... an I2C bus can have mulitple devices connected to a single bus, as long as each device has a unique address. Similar questions have been asked before, and I suggest you read up on the I2C bus and eddit/update your question as required. \$\endgroup\$
    – Puffafish
    Commented Jun 13, 2023 at 12:02

2 Answers 2

3
\$\begingroup\$

To put an answer together properly….

An I2C bus can have multiple devices connected to a single bus, as long as each device has a unique address. Similar questions have been asked before, and I’m sure some basic searching will get you lots more information about this.

The important thing about the I2C is: as long as each device has a unique address, you can have as many devices on the bus as you have address space, and drive strength to handle. I have usually found drive strength (due to the capacitance of the line and devices) and speed are my limiting factors in I2C busses rather than address options.

Usually, your I2C device will have an address pin or two, where you can select different addresses, which gives you more options.

As for the JTAG vs SWD part of your question, the eval board you link to also has a USB port on it, so that will just confuse matters. But for the device itself, you can use JTAG (which is more generic and would be my preferred choice) or you can use SWD over JTAG, both are listed as options in the device’s datasheet.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you for the answer. So, I don't want to use the Eval board. I am using this WFI32E01PC module in my custom board. In that case, which one should I chose for programming and debugging? JTAG or SWD? Any idea? \$\endgroup\$
    – Freshman
    Commented Jun 13, 2023 at 12:40
  • \$\begingroup\$ Actually, you can connect multiple devices with non-unique address to same I2C host controller, if they are on a different bus section, behind a multiplexer for example. Then only one device at a time will be connected to the bus section that connects to I2C host controller, so they can work even if you have multiple chips with identical addresses. \$\endgroup\$
    – Justme
    Commented Jun 13, 2023 at 12:48
  • \$\begingroup\$ @Freshman I'd choose JTAG, but it's up to you and your set up \$\endgroup\$
    – Puffafish
    Commented Jun 13, 2023 at 12:50
  • \$\begingroup\$ @Justme You can also use multiple of the same I2C address if they have enable signals, or if they are output devices and you want the same output. But that was getting too complicated for a basic question. \$\endgroup\$
    – Puffafish
    Commented Jun 13, 2023 at 12:51
2
\$\begingroup\$

No, you are not correct. You don't require 3 I2C buses to connect 3 chips. 3 chips can be on one bus segment provided that there are no overlapping addresses. If there are identical addresses, the bus must be sectioned with muxes to allow for multiple segments with one segment accessible at one given time.

And if you really do want multiple I2C buses, any amount of I2C buses can be achieved with software bit banging, until you run out of GPIO pins.

\$\endgroup\$
2
  • \$\begingroup\$ Thank you for the answer. Could you please address your thoughts on the JTAG vs SWD interface question? \$\endgroup\$
    – Freshman
    Commented Jun 13, 2023 at 12:41
  • 1
    \$\begingroup\$ @Freshman No I can't because I have never heard of that module and you are asking multiple unrelated questions in one, so I did not even read that far to notice the second question. Ask only one or at least somehow limit the questions to revolve around one subject. Stick to the topic. \$\endgroup\$
    – Justme
    Commented Jun 13, 2023 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.