Home > Forum > Controllers SlimLine e Netsyst (LogicLab) > Connect I2C devices to the expansion bus SlimLine
- This topic has 9 replies, 6 participants and was last updated 4 years, 1 month ago da Sergio Bertana.
-
AuthorPost
-
June 5, 2017 at 12: 07 pm #35657RubenParticipant
I need to interface to one SlimLine an I2C device that works at 3.3V. I would like to know if it is SlimLine has internal pull-up resistors at 5V, or if I can use external pull-up resistors at 3.3 Volts.
June 5, 2017 at 12: 15 pm #36634Sergio BertanaAdministrator ForumThe I2C systems expansion bus SlimLine is at 5 Volts, the internal circuit already has the pull-up resistors for the Clock and Data signals. If you use 5 Volts devices you can connect them directly to the expansion bus as shown in the Hardware reference manualIf your 3.3 Volts device is tolerant 5 Volts you can connect it directly, otherwise you must use an I2C level translator (Example a PCA9507) like the one indicated in the manual.
February 16, 2018 at 10: 19 am #40030FabioParticipantIn another post I realized that the I2C expansion bus was not compatible with other instruments than expansion cards Elsist. Can you give me some information?
February 17, 2018 at 7: 28 am #40031Sergio BertanaAdministrator ForumThe system expansion bus SlimLine and systems Netsyst is a standard I2C bus, so it is possible to interface any device with I2C interface. The bus operates with a frequency of 400KHz so the devices must support this communication frequency.
In the function library supported by LogicLab there is the function SysI2CWrRd (Manual extract) that allows you to read and write data to the devices connected to the bus. In the forum you will find several topics that deal with the topic with example projects for the management of commercial modules. In this topic, a program to manage a PIO PCF8574. In this topic a program to manage the Arduino compatible SainSmart LCD display.
Probably your confusion was born of this post where it deals with the opposite argument, that is the possibility to manage our expansion modules from a proprietary master I2C CPU module. In this case, even if the I2C bus is standard, the communication protocol between the CPU and the expansion modules is a proprietary solution for which we do not provide the specifications.
February 23, 2018 at 12: 13 pm #39969StefanoParticipantI found this interesting project relative to a rotary encoder on I2C bus. There may be contraindications when using it on the expansion bus SlimLine ? More like a maximum length of connections.
February 28, 2018 at 3: 44 pm #39967Sergio BertanaAdministrator ForumWe do not give a maximum distance for the I2C bus, among ours expansion cables you can also find the 1 meter cable. Of course these are terminal cables so you can only use 1 at the end of the block of modules (All interconnected with each other with the extension cables). Having said that for the distance much depends on the electrical "noise" in which the bus cable is located , it is clear that in a laboratory where there are no disturbances I can lengthen the cable a lot, while in an industrial environment (Environment where our products usually operate) I have to be much more careful (Topic).
October 11, 2019 at 2: 26 pm #50187Sergio.ghirardelliParticipantI downloaded LogicLab, but the function SysI2CWrRd it is not present in the libraries. I saw that it is part of the XTarget_07_0 library, but it is not possible to download it from the site. Is it possible to find it somehow?
October 11, 2019 at 2: 33 pm #50192Sergio BertanaAdministrator ForumAll objects functions and FB whose name starts with Sys, they are system objects, so they are embedded and therefore being inherent in the operating system are always available.
The fact that it is indicated XTarget_07_0, means that it was already available from that version of target, today we are at XTarget_12.
To see it if you open the window of the libraries embedded in LogicLab <Ctrl-L> or menu View -> Tool Windows -> Operators and blocks you will see that you find it. Positioning the mouse on the object you can drag it into the project and with the object selected the button [F1] opens the manual on the contextual page.
March 27, 2020 at 10: 47 am #54305AliceParticipantI need to connect several I2C slaves that share the same address (0x44) to the same SlimLine.
I was thinking of using an I2C multiplexer like the TCA9548A, to which however I have to send a byte with the addressing (1 high bit from 0 to 7) to specify which channel I am using. Is there any way to do this? or is there an alternative to using the multiplexer?
March 27, 2020 at 10: 52 am #54344Sergio BertanaAdministrator ForumI have never used I2C multiplexer like the one you mention, but reading the datasheet I seem to understand that the multiplexer uses an I2C address for its management.
So no problem, execute a 1 byte write command on the multiplexer's I2C address indicating which channel you want to activate. From this moment all I2C commands will go out on the addressed channel.
Alternatives ... If the components you use have an enable pin you can parallel them all on the I2C bus and then you will have to manage (Maybe with an I2C PIO) the various enabling commands.
-
AuthorPost
- You must be logged in to reply to this topic.