﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>RoboticsConnection User Forum / RoboticsConnection Software Support / Serializer .NET Library  / I2C Generic to MD23 / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>RoboticsConnection User Forum</description><link>http://www.roboticsconnection.com/userForums/</link><webMaster>info@roboticsconnection.com</webMaster><lastBuildDate>Thu, 04 Dec 2008 14:26:05 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: I2C Generic to MD23</title><link>http://www.roboticsconnection.com/userForums/Topic247-6-1.aspx</link><description>Hey guys,&lt;br&gt;&lt;br&gt;I haven't tried this with the MD23, but I am using an MD03 (the high-current motor driver from Devantech) and it works like a charm! :D  I was very confused before I saw this thread, so thanks for raising it! :cool:&lt;br&gt;&lt;br&gt;I haven't been able to find ANY examples of people using the MD03 with the Serializer yet, so I may as well use this opportunity to specify that it does work!  Just follow the examples above and it should be sweet :)...&lt;br&gt;&lt;br&gt;Sam</description><pubDate>Wed, 03 Dec 2008 22:24:29 GMT</pubDate><dc:creator>sammy34</dc:creator></item><item><title>RE: I2C Generic to MD23</title><link>http://www.roboticsconnection.com/userForums/Topic247-6-1.aspx</link><description>Great information, thanks for all the help!  I believe I understand the examples you provided, and I look forward to trying it out soon.  (Still need to get a power supply for my MD23 so can't check it out right away).</description><pubDate>Wed, 26 Mar 2008 20:31:57 GMT</pubDate><dc:creator>cjohns</dc:creator></item><item><title>RE: I2C Generic to MD23</title><link>http://www.roboticsconnection.com/userForums/Topic247-6-1.aspx</link><description>Thanks for opening this thread up! :)&lt;P&gt;If you wanted to read the values of the MD23, you would basically send a write command to the address of the device, followed by the register you want to read, then you would issue an additional write to the same address, along with the number of bytes that you want to read from that register, which in the case of the battery is 1 byte.&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;void&lt;/FONT&gt; ReadMD23Battery()&lt;BR&gt;{&lt;BR&gt;        i2cd.Write(0xB0, &lt;FONT color=#a31515&gt;"10"&lt;/FONT&gt;);&lt;BR&gt;&lt;FONT color=#0000ff&gt;        byte&lt;/FONT&gt; voltage = &lt;FONT color=#2b91af&gt;Convert&lt;/FONT&gt;.ToByte(i2cd.Read(0xB0, &lt;FONT color=#a31515&gt;"1"&lt;/FONT&gt;));&lt;BR&gt;&lt;FONT color=#0000ff&gt;        &lt;BR&gt;        // use voltage for whatever&lt;BR&gt;        &lt;BR&gt;        Console.WriteLine("Battery Voltage: {0}", voltage)&lt;/FONT&gt;;&lt;BR&gt;} &lt;/P&gt;&lt;P&gt;If you wanted to simply write a value to the mode bit, then you would simply send the following:&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;void&lt;/FONT&gt; WriteMD23Mode(&lt;FONT color=#0000ff&gt;byte&lt;/FONT&gt; mode)&lt;BR&gt;{&lt;BR&gt;&lt;FONT color=#0000ff&gt;       string&lt;/FONT&gt; cmd = &lt;FONT color=#2b91af&gt;String&lt;/FONT&gt;.Format(&lt;FONT color=#a31515&gt;"15 {0}"&lt;/FONT&gt;, mode);&lt;BR&gt;       i2cd.Write(0xB0, cmd); &lt;BR&gt;}&lt;/P&gt;&lt;P&gt;Please note that I cannot debug this as we don't have an MD23. :)  I'm sure you can take it from here...The .NET lib and Serializer firmware hide a lot of the tedious stuff you typically have to deal with when using I2C devices (e.g. start bits, etc.), so you don't have to worry about it (which is the whole point). :cool:&lt;/P&gt;&lt;P&gt;Please note that the "i2cd" object would be defined somewhere in your application.  It's basically just an I2CDevice().&lt;/P&gt;&lt;P&gt;Let us know if this worked for you.&lt;/P&gt;&lt;P&gt;I'll add more documentation on the Generic I2C interface to the Serializer .NET Lib example too.&lt;/P&gt;&lt;P&gt;Best Regards!</description><pubDate>Wed, 26 Mar 2008 17:42:58 GMT</pubDate><dc:creator>jsummerour</dc:creator></item><item><title>I2C Generic to MD23</title><link>http://www.roboticsconnection.com/userForums/Topic247-6-1.aspx</link><description>Jason,&lt;/P&gt;&lt;P&gt;Thanks for your response to my earlier post.  I'll pull this out into a separate topic in case it might help someone else.  I saw the I2CDevice object and figured that would be the way to go, for communicating with the not-yet-supported MD23 I2C device.  &lt;/P&gt;&lt;P&gt;However, I got a little hung up with the I2C byte sequences that you mention.  The MD23 documentation discussing the registers, etc., is at &lt;A href="http://www.robot-electronics.co.uk/htm/md23tech.htm"&gt;http://www.robot-electronics.co.uk/htm/md23tech.htm&lt;/A&gt; and it describes "first send a start bit, the module address (0xB0 for example) with the read/write bit low, then the register number you wish to read [there is a list of registers, 0-16, in a table there].  This is followed by a repeated start and the module address again with the read/write bit high (0xB1 in this example).  You are now able to read one or more registers."&lt;/P&gt;&lt;P&gt;Being a relative newbie to I2C and serial communication, I haven't quite been able to translate that into C#, let alone English :)&lt;/P&gt;&lt;P&gt;What i2cd.Write() command(s) would I issue to this (assuming it's at its default I2C address, 0xB0) to read the battery volts (register 10) and write a mode of "2" to register 16?  [A read example and a write example should be enough to get me off to the races!] :)&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Wed, 26 Mar 2008 11:45:20 GMT</pubDate><dc:creator>cjohns</dc:creator></item></channel></rss>