Enable usage in CODESYS installing the i2c software tools after connecting the hardware and activation of the i2c bus.
sudo raspi-config
Choose Advanced Options -> "activate I2C" -> "Yes" and exit the tool. Now update the repository and install i2c-tools
sudo apt-get update sudo apt-get install i2c-tools
check the addressing/connections Once you have it installed check that the RTC has been detected using:
sudo i2cdetect -y 0 # (if using Raspberry Pi 1 or) sudo i2cdetect -y 1 # (if using Raspberry Pi 2 or later)
Note: The MC3200 has 4 possible i2c addresses in my case it is 0x28. This output should now look something like this;
admin@CodesysPLC:~ $ i2cdetect -r -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- 28 -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
Talk Topic about project #i2c-te-m3200
Log in to post a comment.
Enable usage in CODESYS
installing the i2c software tools after connecting
the hardware and activation of the i2c bus.
sudo raspi-config
Choose Advanced Options -> "activate I2C" -> "Yes" and exit the tool.
Now update the repository and install i2c-tools
check the addressing/connections
Once you have it installed check that the RTC has been detected using:
Note:
The MC3200 has 4 possible i2c addresses in my case it is 0x28.
This output should now look something like this;
Talk Topic about project #i2c-te-m3200