PDA

View Full Version : I2C Pins Assignment



Peter1960
- 31st May 2006, 01:53
Hi,

Do you have to use the assigned ports on a PIC to I2C ie SCLK and SDAT or can you define them ?

Peter

mister_e
- 31st May 2006, 03:29
If you play with the PIC internal MSSP, you have to use the default pins... same for PWM and USART.

If you use I2CREAD/I2CWRITE, you can use almost any i/o as it's a software solution. Like SERIN/SEROUT against HSERIN/HSEROUT

DynamoBen
- 3rd June 2006, 21:05
Really? I assumed that if you were using I2CRead/I2CWrite you had to use the pins in the datasheet, much like HSERIN/HSEROUT.

mister_e
- 3rd June 2006, 21:49
IMHO the H mean that a PIC Hardware module is used
Hserout ---> Serout
Hpwm ---> PWM

If one day Melabs decide to do something that use the internal MMSP, they will probably call it HI2CREAD, HI2CWRITE, HSPIREAD...

Another point, if I2CREAD/I2CWRITE had used the internal MSSP, it will'nt give you the choice to specify the SDA and SCL pins... same for Serout, .. ,..

I2CREAD/I2CWRITE allow to create as much I2C Bus as you have capable I/O on your PIC. That's a good point when you need it. Sure slower than what the MSSP can provide but if it's just for some simple EEPROM, DAC, ADC, I/O expander... it's fast enough in most case.

DynamoBen
- 4th June 2006, 01:54
Hmm interesting. I guess I really never thought it through. Well this will help me a little when commiting the design to a board.