On Tue, 6 Jan 2004 15:36:08 -0700, Robert Rolf wrote on Re: [PIC:] Pic as an i2c slave. Debug bits: >> I am also thinking of the possibility that the basic >> compiler I use may mask interrupts when performing certain >> "special" instructions (or rather macros) such as writing to >> a LCD display module. This I could find by browsing in the >> assembler file... > >It is quite likely that interrupts are being turned off in >some routines. I have browsed the whole assembler file compild fo my "big" (8k) application, and found no trace of interrupt stuff (enabling or disabling) by the compiler. This is what I thought I would find, because that compiler has a special system for interrupts, that are delayed under the current basic instruction has been executed; in other words, basic routines cannot be iterrupted in the immediate sens of the term. >Quickest way to find out is to set up a timer interrupt at >the byte rate you expect from the I2C port and just toggle a bit. >Any jitter in the width of the pulses will show you just how bad >the latency is. Nice and easy to do: I'll test it. >You could also toggle a 'debug' bit as part of your I2C service >routine. I found that setting a bit at the start, and clearing >it just before I returned, gave me a great deal of insight into >how well my various ISR routines were handling things, and helped >me add additionally polling points as required. I also use such methods. Thank you for these suggestions, Robert * Xrobert.soubie@free.frX (veuillez supprimer les "X") * http://www.astrosurf.com/soubie * Au royaume des aveugles, les borgnes sont mal vus... - P.Dac -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.