Hi, I'd like to test the clamp voltage for a surge supresor, could some one help me with this kind of test. Regards Julio > -----Mensaje original----- > De: Tobie Horswill [SMTP:thorswil@EXMACHINA.QC.CA] > Enviado el: Tuesday, September 25, 2001 9:31 AM > Para: PICLIST@MITVMA.MIT.EDU > Asunto: [PIC]: strange MSSP slave behaviour > > Hi, I've got 2 x F877 talking to each other via i2c. One master and the > other slave. My i2c master routines work fine with a 24LC64 EEPROM and > also > with an i2c LCD module on the same bus. When I try sending stuff to the > slave PIC however things get a bit weird. > > I've used Microchip's AN734 source almost textually (added a few > diagnostic > LEDs and Tony Nixon's ROMZap) for the slave PIC. The applications note's > code seperates all incoming i2c events into 6 possible states. > > 1: Master write, last byte was an address (SSPSTAT = XX0X 10X1) > 2: Master write, last byte was data (SSPSTAT = XX1X 0X10) > 3: Mater read, last byte was address (SSPSTAT = XX0X 11X0) > 4 Master read, last byte was data (SSPSTAT = XX1X 11X0) > 5 Master NACK (SSPSTAT = XX1X 10X0) > 6 all other SSPSTAT configurations will generate an error condition > > START, STOP and ACK events being taken care of automatically by the MSSP > hardware I assume. > > Now, if I send the standard i2c write "stream" of START, ADDRESS, DATA, > STOP > from the master (waiting for ACKS from the slave after each byte), the > slave should first fall into state 1 after the ADDRESS event and then into > state 2 after the DATA event right ? Well, it doesn't. Instead it always > ends up branching to state 6 at some point (I haven't been able to > identify > where yet). Everything works fine if I insert a 1mSec delay after the > ADDRESS and DATA bytes from the Master though. I tried replacing the 1mSec > delay by one or more NOP but it's not enough. Why the delay since the > master > waits for (and DOES receive) an ACK from the slave before sending the next > byte ? > > MSSP baudrate generator is set to 100kHz, i2c threshold levels are > selected, > slew rate control is disabled, 2.2k pull-ups on SDA and SCL (also tried > 4.75k), tried removing the EEPROM and the LCD from the bus. no cigar. > > Any ideas ? > > kind regards, > > _______________________ > Tobie Horswill > thorswil@exmachina.qc.ca > Ex Machina > 103, rue Dalhousie > Quibec (Quibec) CAN > G1K 4B9 > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics