>-----Original Message----- >From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] >Sent: 14 March 2005 13:35 >To: Microcontroller discussion list - Public. >Subject: Re: [PIC] slave I2C problems, WCOL bit > > >>It is possible to work around this by checking WCOL immediately after >>writing to SSPBUF (which, on the other hand, is exactly what the code >>from AN734 does), e.g.: > >Hmm, I converted the AN734 code into an interrupt routine >using Olins modular system, and never had the sort of problems >you see. Just looked through the code, and it is as you say. I >cannot remember why it is possible to have a write collision. >It may be related to the following possibly happening - > >last bit of byte shifted out - set interrupt flag >PIC tries to load next byte - master not yet ack'd previous >byte so collision. The SSPIF flag is set on the falling edge of the ACKnowledge clock bit, so you *shouldn't* ever get into the ISR before the entire byte has been sent and acknowledged. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist