>-----Original Message----- >From: Bob Axtell [mailto:cr_axtell@YAHOO.COM] >Sent: 06 January 2004 21:50 >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: [PIC:] Pic as an i2c slave > >Really, look at it; the I2C portion of MSSP is really limp. >First, you can do either I2C OR SPI on the same chip, not >both. Then, you get an interrupt on START and STOP, and the >ACK is OK- fine; but you don't get much more than that. >Everything else you do has to be heavily "tinkered with". > It has it's faults but I don't think it's anywhere near as bad as you are saying. I have thousands of product in the field working perfectly with the MSSP configured as slaves and interfacing to customers equipement. You don't get an interrupt on start and stop, at least I've never used it in this way. The PIC simply provides an interrupt whenever a byte has been sent to the master (and acknowledged) or when a byte has been received from the master. There are status bytes (SSPSTAT/SSPCON) that can be used to tell if the incomming byte is an address or data byte, whether there has been a buffer overflow etc. Once the operation of the MSSP module is fully understood, writing the code to implement a robust slave is not very difficult. >A proper I2C hardware engine would operate seamlessly. The >slave engine would know when a start bit is expected, and >properly turn on WHEN THE ADDRESS MATCHES and proceed to >accept data, with a status byte somewhere keeping up with what >kind of data was coming in. This is more or less exactly what the MSSP does. >Even the 7-bit/10-bit address >could be handled. It would then be reset when the STOP bit >occurred. Even an 8-byte I/O FIFO would be nice... > The MSSP does handle 10 bit addressing, but some software intervention is required. It's a no-brainer though. 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. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads