> -----Original Message----- > From: Roman Black [SMTP:fastvid@EZY.NET.AU] > Sent: Friday, May 18, 2001 8:13 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: I2C slave software for the PC to talk to a PIC > > > > From: James Newton [SMTP:jamesnewton@PICLIST.COM] > > > Sent: Thursday, May 17, 2001 4:40 PM > > > To: PICLIST@MITVMA.MIT.EDU > > > Subject: [PIC]: I2C slave software for the PC to talk to a PIC > > > > > > The I2C resources on the piclist.com site and in the archives and on > > > google > > > don't seem to include PC I2C slave software... > > > > > > ...which would seem to be very useful for testing PIC I2C masters... > > > > > > ...am I just missing it? > > Michael Rigby-Jones wrote: > > Reason being it is very difficult to write a pure bit bashed slave on a > PC > > that will run at reasonable speeds. You really need a small amount of > > external logic to make this feasable, something to detect stop/start > > conditions, and a shift register. > > > Olin Lathrop wrote: > > What hardware would you have the PC use for IIC? "Standard" PCs don't > come > > with IIC ports. IIC requires two open collector drivers. I vaguely > > remember that some of the parallel port control lines are open > collector, > > but am not sure. Even if so, you would need to write a custom kernel > mode > > device driver to mess with the parallel port in a non-standard way. It > > would be easier to hook a PIC to a serial port or parallel port and have > it > > do IIC for the PC. > > > Yeah, it can be done fine. I'm always connecting PIC > stuff to my parallel port. I don't see the speed as > much of a problem, 100kbps should be fine, don't know > if you would get 400kbps but it might be possible. > > I would use 3 pins of the PC par port, 2 as inputs for > the SDA and SCL, and one (output) through a diode which > would be used to pull the SDA low for acks etc. Probably > 3 resistors and one diode needed. > > I write stuff in Turbo C for dos, you can read and write > the port with ONE asm instruction and provided you can > go to dos mode and kill that windows POS you can get > some pretty impressive port performance. That's one > reason I stick with Win95, you can force dos mode. > > The lead length is not that critical at 100kbps, probably > a few feet would be ok. :o) > -Roman > Roman, You are talking about an I2C Master implementation which is pretty trivial compared to a slave. I'm starting to get interested in designing a cheap bus analyser though. Will have to do some "back of envelope engineering" at lunch time! Mike -- 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