On Tuesday 01 January 2008, Colin F. MacKenzie wrote: >Yes, they support clock-stretching, this is pretty normal. They also >support multi-master (I am 99% sure). Really, tho, it's the adapter >driver that determines the clock-stretching support (ability to read >status of clk line). My custom adapter using a CPLD supported it. > >What is really nice about the linux i2c support is that it is well laid >out and simple to extend. For example, you can (in a sense) sub-class an >existing driver if the parent provides the bulk of the functionality. >For example, the parallel port i2c driver references the bit-banging >driver and only needs code to toggle the clk/dta lines on or off; so 4 1 >line functions + 1 register + 1 unregister function (short too). The par >port sets the clock line using an output pin, and reads the status of >the clk line on a separate par port input pin. > >Each client (i2c device) has a simple driver. The linux i2c base >implementation does a bus scan, then queries every client driver for >every found device to have the client driver return yes or no if it >recoqnizes the device. There is a lot of functionality already done so >all we have to do is handle the most basic hardware details. > >I have sample i2c linux code for both an adapter and client device. The >client device in this case was a digital hobby servo as seen on my >website. >http://www.colinmackenzie.net/ > >If you want it let me know, I will send as attachment to anyone. > >C
Just a heads up on the i2c stuffs, it has a very definite brick wall distance it can run at. We once had an effects controller at the tv station that used i2c between the control panel and the unit, which had to be in the racks near the controlled point. The supplied cable was 30 feet. Worked fine but we needed another 3 to 5 feet to really put the controller where it was handy to the tech directors. I spliced another 5 feet of near identical cable into it and it died. Stuff looked like std 4 wire flat phone cable. I got 50 feet of the identical cable from the gear maker and made 35 feet of that up, no go. I called the gear maker and they flatly informed me that the cable they supplied was as far as the protocol could go, no if's, and's, or but's. We wound up trying to have 2 people co-ordinated enough to use it, and it got pretty obvious at times on the air in the middle of a newscast. >-----Original Message----- >From: Stephen Wille Padnos [mailto:[EMAIL PROTECTED] >Sent: Tuesday, January 01, 2008 9:14 PM >To: Enhanced Machine Controller (EMC) >Subject: Re: [Emc-users] Additional I/O Modbus card. > >Colin F. MacKenzie wrote: >>Linux has great i2c bus support, I have made i2c adapter and client > >(i2c > >>device drivers), they are only a page or so of code. This is a two wire >>protocol. They are great for non-realtime sensors or controls. > >Do the Linux drivers deal with slaves that do clock-pulse stretching? > >Technically, the clock line can be driven (low) by the slaves if they >are slower than the master. So theoretically, you'd need bidirectional >control of both the SDA and SCL lines. > >Of course, if it works, then "practically" trumps both "technically" and > >"theoretically" :) > >- Steve > > >------------------------------------------------------------------------ >- >This SF.net email is sponsored by: Microsoft >Defy all challenges. Microsoft(R) Visual Studio 2005. >http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >_______________________________________________ >Emc-users mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/emc-users > > > >------------------------------------------------------------------------- >This SF.net email is sponsored by: Microsoft >Defy all challenges. Microsoft(R) Visual Studio 2005. >http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >_______________________________________________ >Emc-users mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/emc-users -- Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Noncombatant: A dead Quaker. -- Ambrose Bierce ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
