PDA

View Full Version : I2Cwrite - ok to use in a program that uses a lo of interrupts?



HankMcSpank
- 18th September 2010, 16:34
Ok, having established that it's not a good idea to use SEROUT when interrupts are used in the same program - but is this true of the PBP I2Cwrite command too?

I've just recently got SPI working in PIC hardware (vs bit shifting out a pin) - but I'm having difficulty finding any similar hardware examples for I2C?

Jerson
- 18th September 2010, 16:51
I2Cread / write are more tolerant of timing requirements as they are clocked synchronously. SEROUT/IN and its variants are async and surely have a problem with anything disturbing their merry timing. Option is use HSERIN etc

HankMcSpank
- 18th September 2010, 16:55
I2Cread / write are more tolerant of timing requirements as they are clocked synchronously. SEROUT/IN and its variants are async and surely have a problem with anything disturbing their merry timing. Option is use HSERIN etc

Hi Jerson - you've stumped me there!

I'm wanting to control a MCP4651 (a dual I2C POT) with a 16F690 using I2C (so PIC as master....sending 'wiper' positional data to a pot) .....where does HSERIN come into play?

Jerson
- 19th September 2010, 02:46
Hehehe

that came from your first statement. Having established ...... It has no connection with I2cwrite. Just an opinion of mine that was expressed on Serout2 and interrupts

rsocor01
- 19th September 2010, 18:18
Also, you can use I2Cwrite when you are in the interrupt routine, when the interrupts are disabled. I ussually do it like that without any problems.

Robert