I understand that I can interact with I2C devices by any port if I use Bit banging, but I get the impression that some PIC processors have facilities to act as an I2C host.
1) Which PIC processors have the I2C host support.
2) How are the I2C devices wired to the PIC processor in this case.
3) I notice E-Blocks that support I2C devices tend to use Port C is this significant
Thanks Keith
I2C Programming.
-
- Posts: 114
- Joined: Fri Jul 27, 2007 10:50 am
- Been thanked: 1 time
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello Keith
1) The I2C host support is reffered to as MI2C. You can see a breakdown of the devices that have this functionality here.
http://www.microchip.com/ParamChartSear ... &pageId=74
There is also a similar page for the PIC18 series.
2) The I2C bus is two lines: SDA - Data and SCL - Clock. All you need to do is connect these lines to the lines on your remote I2C devices and then add a 10K pull up resistor to each line.
3) Most PICmicros use portC as the special function port. This includes I2C, UART and SPI. Therefore this is why the E-Blocks connect to portC.
1) The I2C host support is reffered to as MI2C. You can see a breakdown of the devices that have this functionality here.
http://www.microchip.com/ParamChartSear ... &pageId=74
There is also a similar page for the PIC18 series.
2) The I2C bus is two lines: SDA - Data and SCL - Clock. All you need to do is connect these lines to the lines on your remote I2C devices and then add a 10K pull up resistor to each line.
3) Most PICmicros use portC as the special function port. This includes I2C, UART and SPI. Therefore this is why the E-Blocks connect to portC.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 114
- Joined: Fri Jul 27, 2007 10:50 am
- Been thanked: 1 time
- Contact:
I2C Programming.
Many Thanks Ben for the info.
Just to confirm my reading of the documentation.
If I was to build my own E-Block with an I2C slave device on it. I would be best advised to make pin 3 SCL and pin 4 SDA. Then plug into Port C.
Thanks Keith
Just to confirm my reading of the documentation.
If I was to build my own E-Block with an I2C slave device on it. I would be best advised to make pin 3 SCL and pin 4 SDA. Then plug into Port C.
Thanks Keith
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
The PIC datasheet tells you which pins are which if you look at the pin diagram near the beginning of the datasheet then you will see the SCL and SDA pins. If you want to bit bang the output then you can use any pin you wish.
The PIC datasheet tells you which pins are which if you look at the pin diagram near the beginning of the datasheet then you will see the SCL and SDA pins. If you want to bit bang the output then you can use any pin you wish.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel