Two I2C buses on MOD5270
Two I2C buses on MOD5270
I would like to act as a slave on an I2C bus that is isolated from the bus I am acting as the master on. The samples I have use the Master only , or the multi-master mode (in which the module acts as a master and slave on the same bus). One of our hardware engineers believes we have two unused pins that the data sheet claims can be used as another I2C, but I did not see this capability in the documentation. Has anyone done this and if so could they direct me to the correct documentation.
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: Two I2C buses on MOD5270
Most of the NB modules have one i2c peripheral, although the SDA and SCL pins functions can often each be assigned to one or more pins. Look in the c:Nburn\yourModule\pinconstants.h file (where yourModule = MOD5270, MOD5282, etc.) For example, on the Mod5270, SDA can be mapped to either J2[27], or J2[39]. Similarly, SCL can be mapped to J2[25] or J2[42]. That said, there is only ONE i2c peripheral on most of the devices. The one exception is the 5234, which, because of its eTPU unit, can be configured to have multiple i2c interfaces. I haven’t tried it, but with 16 eTPU pins, you could conceivably have 8 i2c peripherals in addition to the one that is built into the CPU core.
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: Two I2C buses on MOD5270
As an afterthought, you indicated that you were using the 5270. It has one i2c channel. If you really need an add'l i2c, the 5234 is the NB module most compatible with the 5270...? You might be able to just replace the 5270 with the '34. Most of the code for the 5270 peripherals runs on the 5234. Just a thought.
Re: Two I2C buses on MOD5270
I think the I2C signals can just come out in two different pin sets, but there is only one I2C on the module. One alternative would be to use GPIO and bit-band your own I2C interface.
Re: Two I2C buses on MOD5270
Thanks Ridge and Nix,
That answers the question, and gives me a few options on how to approach the issue. Now it is just a matter of finding the best and most cost effective approach for us,
Brian
That answers the question, and gives me a few options on how to approach the issue. Now it is just a matter of finding the best and most cost effective approach for us,
Brian
Re: Two I2C buses on MOD5270
dont know if this is an option for you, but there are multi channel I2C chips out there that provide 2,4or 6 channel I2C ports from one master input. You can direct the traffic via ~CS lines to the chip.
Re: Two I2C buses on MOD5270
Everyone is correct here that the MOD5270 only has a single I2C peripheral. The signals are multiplexed to 2 sets of pins... only one set can be active. The MOD5234 eTPU can perform I2C on any of the eTPU channels for up to 8 additional I2C interfaces.
The MOD5272 does not have a I2C peripheral. In the NNDK there is a bit banging I2C driver for this module that uses GPIO and a hardware timer to create a master I2C peripheral. NetBurner source files can not be posted on the forum but if you have an active support account you can make a request for the bit banging driver through NetBurner support. You will have to modify the driver to use one of the timer modules on the MOD5270 but that should be pretty simple. Then any of the pins will be able to be master I2C devices and you can use the dedicated I2C hardware peripheral with the multi driver as your slave.
-Larry
The MOD5272 does not have a I2C peripheral. In the NNDK there is a bit banging I2C driver for this module that uses GPIO and a hardware timer to create a master I2C peripheral. NetBurner source files can not be posted on the forum but if you have an active support account you can make a request for the bit banging driver through NetBurner support. You will have to modify the driver to use one of the timer modules on the MOD5270 but that should be pretty simple. Then any of the pins will be able to be master I2C devices and you can use the dedicated I2C hardware peripheral with the multi driver as your slave.
-Larry