Defining an I2C communications module in existing code

Discussion to talk about hardware related topics only.
Post Reply
sehsamudra
Posts: 19
Joined: Fri Sep 23, 2011 10:11 pm

Defining an I2C communications module in existing code

Post by sehsamudra »

Hi, so far I have had good success in using MOD5270 and a dev board with the existing UART for all my applications. All commands for the menus are available through regular serial terminals on PCs etc.

For a special version of my microthruster control unit research platform I have to use I2C to interface with an external equipment that has a microprocessor board also using I2C, the Microchip dsPIC33FJ256GP710 instead of this UART channel. In the lab, both systems will be located in very very close proximity to each other, but separate, perhaps 2-3".

I would like to have the Microchip application code send me the same serial commands using I2C instead of a UART if possible.

Would the sample MOD5270 I2C2Serial code suffice for a test application on a MOD54415 as well? Could I use the two platforms to test out I2C -- I2C communication?

Would the I2C interface (I am not into the details yet) on the netburner platforms be wholly compatible the dSPIC33 ? Is this is a case of a multi-master implementation?

Any tips / guides would be greatly appreciated.
mbrown
Posts: 61
Joined: Tue Jan 29, 2013 7:12 pm

Re: Defining an I2C communications module in existing code

Post by mbrown »

If you have two modules on hand, the easiest way to test and develop with the I2C bus is going to be starting with the I2C2Serial example for the 5270. I'm fairly certain the MOD54415 should be able to run the example without any alteration as long as you tell Eclipse that you're building the project for the MOD54. With both modules, you'll want to hook up the SDA and SCL lines to some pull up resistors as neither have them on module. You can always develop with one module and another device that communicates via I2C, but since the protocol requires acknowledgements from a slave device, you can't just have a master send messages with no one listening and try to look at the signals on a scope.

Whenever I'm running some test code with the I2C bus, I just start with a breadboard with a pair of 10k resistors next to some MOD-DEV-70s and two modules talking to each other and dumping whatever comes out on the serial port through MTTTY.

Talking to other devices shouldn't be a problem as long as the voltage ranges are compatible and somewhere along the lines you've got pull-up resistors.
sehsamudra
Posts: 19
Joined: Fri Sep 23, 2011 10:11 pm

Re: Defining an I2C communications module in existing code

Post by sehsamudra »

mbrown wrote: Whenever I'm running some test code with the I2C bus, I just start with a breadboard with a pair of 10k resistors next to some MOD-DEV-70s and two modules talking to each other and dumping whatever comes out on the serial port through MTTTY.

Talking to other devices shouldn't be a problem as long as the voltage ranges are compatible and somewhere along the lines you've got pull-up resistors.
Thanks, greatly encouraged at this point. I discovered PCA9515 series IC as suggested by others for interfacing.
Post Reply