STMP15X-SHIELD with UEXT modules

Started by msx_23, December 01, 2022, 02:44:44 PM

Previous topic - Next topic

msx_23

Hello,

I have a STMP157-OLinuXino-LIME2 board with STMP15X-SHIELD and I am strugglibng to get UEXT-modules working, for example I have connected MOD-TC-MK2-31855 to UEXT1. But with i2cdetect does not recognize any device and the compiled sample application for MOD-TC-MK2 always says "0°C". So I think the module is not recognized at all. I am not sure with the following questions:

1. On the homepage for the shield it is mentioned that the software is "Included in OLIMAGE" and "Olimage Linux images already have overlay for this shield". Do I have to activate this somehow, or should this work out of the box with "STM32MP1-OLinuXino-LIME-bullseye-base-20220928-143706.img" ?

2. Does the MOD-TC-MK2 need some kind of seperate power supply, special configuration or something? I have just attached the two wires of a k-type thermocouple and hoped for it to work out of the box...

3. Later I also want to add other UEXT-modules too. How can I check if a module is detected at all? Is e.g. i2cdetect the correct command? Do I need any configuration?

Here is the output for i2cdetect which does not change even when I disconnect the MOD-TC-MK2:

root@stm32mp1-olinuxino-lime:/home/olimex/MOD-TC-MK2#  i2cdetect -r -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- 4d -- --
50: UU UU UU UU UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@stm32mp1-olinuxino-lime:/home/olimex/MOD-TC-MK2#  i2cdetect -r -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

For the shield and UEXT module to work I would expect the address 0x23 to show up somewhere...

Any help would be nice. If you need more information feel free to ask.

LubOlimex

There should be an option to enable an overlay for STMP15X-SHIELD. You might need to first update and upgrade the Linux image. Make sure you have established Ethernet connection and run:

apt update

then when done run:

apt dist-upgrade

and agree to upgrade. When done reboot and run the olinuxino-overlay script to enable the overlay for STMP15X-SHIELD.
Technical support and documentation manager at Olimex

msx_23

Ok, thanks a lot that has worked  :)

After the update I could get the following modules to work:
  • MOD-IO2
  • MOD-TC-MK2-31855

However I would like to connect a third module simultaneously via UEXT (and which is not I2C as it seems):
MOD-RS485

Is this possible at all as the Shield only has two UEXT connectors? Or do I need the UEXT splitter that is on your website?

The MOD-IO2-board is described as "stackable", does that mean that I can just connect the MOD-TC to it in a row? Or is this just meant for other MOD-IO2-modules?

When I connect MOD-IO2 to the SBC-UEXT-connector and MOD-TC to the MOD-IO2, the latter is not recognized anymore... Do you have any recommendations?

LubOlimex

But what you tried should work as long as each board has unique I2C address. I think by default MOD-IO2 has 0x21 while MOD-TC-MK2 has 0x23 address.

You can also use UEXTx5 with some CABLE-IDC10-15cm cables to make connections easier without soldering:

https://www.olimex.com/Products/Modules/Interface/UEXTx5/open-source-hardware

https://www.olimex.com/Products/Components/Cables/CABLE-IDC10-15cm/

About MOD-RS485 - it uses UART pins + 2 control pins that you would need to handle by software means. It might be a better idea to consider MOD-RS485-ISO since it uses I2C and is generally easier to use.
Technical support and documentation manager at Olimex

msx_23

#4
Thanks for the fast answer. I also have MOD-RS485-ISO available here. But how do I send and receive data with that module? It has i2c address 0x22, but I dont know how to send/receive datait in Linux...

With the USB-RS485-Adapter USB-RS485 it was pretty straight-forward, I just had to cat/echo the file /dev/ttyUSB0 (or even better using pyserial). But what do I have to do with the MOD-RS485-ISO? I cant find an example online? It would be nice to have the basic commands as it is provided for the MOD-IO module. Can you help me here?

Additional Info 1:
I want to use half-duplex mode and have therefore closed both jumpers and only connected A, B and GND, is that correct?

Additional info 2:
The only thing I have achieved so far is that I can control the red and green LED of MOD-RS485-ISO with
i2cset -y 3 0x22 0x24 0x01 (only green on)
i2cset -y 3 0x22 0x24 0x02 (only redon)
i2cset -y 3 0x22 0x24 0x03 (both on)
I think this might have something to do with read write mode? But I still have no idea how to send/receive...


Edit:

In the meantime I got it to work with the help of the wiki:
https://www.olimex.com/wiki/MOD-RS485-ISO

I think I had some bad cable attached first, which made my communication unreliable...