> > I'm having a problem with my MPLAB/f877's code. > > When I try to dump diagnostics for my i2c program, > > using the USART and a terminal program, my i2c > > slave's interrupts start acting weird. Granted, > > I'm force-feeding PCLATH, so I can use a string > > table, but I'm saving it off when my rs232 print > > function is called, then restoring it (along with > > STATUS and FSR, a la interrupt handling). The > > rs232 code I used from "Serial PIC'n" uses TXIF > > to arbitrate the xmit, so I figure things might > > be getting a little screwy there. I disabled TXIE, > > then tried disabling GIE just during the print routine, > > but it still acts up. Are there any gotchas that > > jump out at y'all? I realize that I've left out > > a lot of details, but I'm hoping that someone has > > tried this kinda thing before. I can give more info > > if needed. > > What are the IIC and UART bit rates? Is it possible that the UART can't > handle the data rate received over the IIC bus? Remember that the UART will > use 10 bit times mininum to transfer a byte, while the IIC can do it in 9. > That appears to be the problem, Olin, thanks! After scoping the i2c signals, it seems that my modification of Microchip's app note, #define FOSC D'18432000' #define I2CClock D'10000' #define ClockValue (((FOSC/I2CClock)/4) -1) didn't actually slow the clock down to 10KHz, and when transmitting rs232 bytes during an i2c interrupt, things got all dragged out. Well, to dump out messages like "Received i2c master address write" during an i2c slave interrupt, should I: 1. Save the string's address (in a 'DT' stringtable), set a timer to interrupt periodically, and ship out one character each time (could I get into i2c timing problems with that as well)? 2. hmmmm...guess that's all I can think of right now! :) I want to run i2c at 100KHz, so dumping diagnostic strings to the terminal may be asking too much for one PIC. Thanks for the help. Ross __________________________________________________ FREE voicemail, email, and fax...all in one place. Sign Up Now! http://www.onebox.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.