At 10:04 28/04/2003 -0700, Ned Konz wrote: >On Monday 28 April 2003 09:40 am, Guillermo Rodriguez Garcia wrote: > > Hi all, > > > > I'm trying to implement a SPI to I2C protocol converter in > > a 16F877 PIC. The PIC will be a SPI slave and a I2C master, > > receiving "commands" over SPI and talking to I2C slave > > devices over I2C. > > > > > > ARM CPU PIC 16F877 ??? > > SPI master <-----> SPI slave | I2C master <-----> I2C slaves > > > > > > I want to implement SPI in the PIC in hardware (MSSP module) > > and will have a software-based I2C implementation. The main > > problem seems to be accomodating the different speeds at > > which SPI and I2C may operate in the PIC side. > >What problems are you having? Both SPI and I2C have their own clock >lines, and in your case you generate the I2C clock yourself. So there >shouldn't be any problems there. You can go as slow as you want. Thanks for replying! The SPI clock line is generated by the master, and I am wondering how to slow it down from the PIC side if the I2C transfer is taking too long (since I2C slaves can stretch the clock at will) to avoid the SPI rx buffer in the PIC being overrun with data that cannot be handled in time. I was wondering if someone had done this in the past and could share some experiences. Thanks, G. -- 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