Using MIKROE-4240

I bought a MIKROE-4240 to use with two TE load cells that come off-the-shelf at the same I2C address. This device brings out the pins of the TI I2C mux to make it easier to try without having to build a board from scratch. But the MIKROE docs are about using their compilers and their Mikbus apparently.

So, I’m looking for help using this board. I use a BeagleBone Black Rev C. so I have to use 3.3VDC logic levels.

  1. How do I power the 4240 safely so I don’t blow out my Beagle? Do I just connected to the pins for 3.3VDC and ground on the breakout board?

It appears that I connect one load cell to output I2C channel 1’s pins and the other load cell to I2C channel 0’s pins. And the Beaglebone to the SCA and SDA pins on the jumpers on the sides. But what line or lines are used to switch between the two channels? Is it done with I2C or some other pin/pins?

Is there any general purpose code out that as examples, preferably in C?

@Matt_Mielke @David_1528

You can P9_01 or P9_02 for GND, and P9_03 or P9_04 for 3v3.

As for interfacing the mux, take a look at this linux driver: i2c-mux-pca954x.c « muxes « i2c « drivers - kernel/git/torvalds/linux.git - Linux kernel source tree using nxp,pca9543

Here’s one example: k3-j721e-sk.dts « ti « dts « boot « arm64 « arch - kernel/git/torvalds/linux.git - Linux kernel source tree

Regards,

@RobertCNelson I wasn’t clear in what I was asking. I want to know what do I connect pins P9_3 (or P9_4) for 3.3VDC to on the Mikro board. It’s not really clear in their documentation. Does the Mikro board need 5VDC? If it does, I know I can get that from header 9 of the BeagleBone Black.
It appears that it’s a choice to use either 3.3VDC OR 5VDC

The Mikro documentation linked to the part on Digikey’s site refers to label JP1 for VCC Sel. But there isn’t a JP1 on the physical board, and there isn’t a JP2 or JP3 on the board for ADDR Sel either.

  1. The board I received has SM jumpers with 0-ohm resistors for jumpers. A jumper is in the position of 3.3VDC. QUESTION: Does this mean that I power it with 3.3VDC by connecting to 3.3VDC pin on the Mikro board (and of course GND to GND)?

  2. The headers on the board have SDA and SCL. Are these the connectors that I connected to the BeagleBone Black’s 's SDA and SCL (P9_20 and P9_19)? Once I have these connected I would expect to be able to ‘see’ the device on the bus using i2cdetect. Right?

  3. Do I connect the slave devices with the same address to the appropriate pins on the other header with one device connected to the four pins for CH0 and the other device connected to the four pins for CH1.

  4. Do I also need to connect some GPIO lines to INT and RST on the board?

And, now that I have it all wired correctly, I communicate over I2C to the board to have it 'switch & read" the slave on the appropriate channel. Right?

(I understand that documentation issues belong to Mikro and not Digikey but Digikey posted this documentation with the product so it might be something Digikey would want to be aware of.)

They do the same on Mikroe’s website: I2C MUX 4 Click at one time there may have been a physical jumpers, but now days it’s just a zero ohm resistor…

JP1 would be the VCC SEL resistor:
JP2/3 would be A1/A0 ADDR SEL

Correct, this board can be powered by either 3v3 or 5v, in the default state it’s setup for 3v3 supply.

Correct, you should see a device over the i2c bus…

Correct, CH, or Channel 0 and Channel 1… Connect Channel 0 to device 0, and Channel 1 to device 1.

IRQ line is required in the linux driver binding: linux/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml at master · torvalds/linux · GitHub

Connecting RST to another pin for control would be useful.

Regards,

2 Likes