<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HCS08GB I2C Help in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130525#M2500</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;My understanding of the operation of the IIC module is that, the MST control bit must be written with a 1 for the master to output a start condition, and then subsequently written with a 0 to output the stop condition.&amp;nbsp; Clearing the MST bit between transactions&amp;nbsp;also allows for the possibility of multiple master operation.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;For the example code&amp;nbsp;given in AN3291, it doesn't appear necessary to disable and re-enable the IIC module prior to each master write sequence, nor does it appear necessary to provide a delay following&amp;nbsp;a start condition.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Oct 2007 11:15:15 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2007-10-19T11:15:15Z</dc:date>
    <item>
      <title>HCS08GB I2C Help</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130520#M2495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1. Is it true the IIC module must be disabled and then enabled for every I2C Master write sequence? I don't see this documented in the MC9S08GB/GT Data Sheet, but it's in the code of the HCS08 Peripheral Module Quick Reference (below). Indeed if I don't disable the IIC module in the function below after the first write, I don't seem to get another I2C Master write.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Is the time delay after the START signal in write function below for the uP operation, or the receiver's benefit?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. I'm having intermittent operation with back to back Master write sequences. Is there a need for some time delay between sending a STOP signal and writing the next byte to the IIC data register? Signal quality appears ok on the board, but the uP sometimes just stops sending during a series of Master write sequences. I'm using the IRQ handler from the HCS08QRUG.pdf.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Any HCS08 IIC programming tips would be welcome!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From HCS08QRUG.pdf:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char WriteBytesI2C (unsigned char slaveAddress,unsigned char numberOfBytes){&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[cut]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IICC_IICEN = 0; // --- disable IIC module&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IICC_IICEN = 1; // --- enable IIC module&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IICS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IICS_IICF=1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IICC_MST = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IICS_SRW=0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IICC_TX = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IICC_MST = 1; // Send Start Bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for(Temp=0;Temp5;Temp++); // Small delay&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ICD=slaveAddress; // Send slave address&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return(1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Sep 2006 16:44:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130520#M2495</guid>
      <dc:creator>video_man</dc:creator>
      <dc:date>2006-09-18T16:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08GB I2C Help</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130521#M2496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Verdana" size="2"&gt;Have you looked at &lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN3291.pdf?srch=1" rel="nofollow" target="_blank"&gt;&lt;SPAN&gt;&lt;STRONG&gt;AN3291: How to Use IIC Module on M68HC08, HCSO8, and HCS12 MCUs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/A&gt;?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Verdana" size="2"&gt;Maybe it can help somehow&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 01:29:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130521#M2496</guid>
      <dc:creator>bitwok</dc:creator>
      <dc:date>2006-11-15T01:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08GB I2C Help</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130522#M2497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm reading AN3291 and it's pretty spotty in the example code department.&lt;BR /&gt;&lt;BR /&gt;For starters, for a master mode example, they show the I2C init to be:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;void Init_I2C (void){IIC1C_IIC1EN = 1; // Enable I2C;IIC1C_TXAK = 1; // not generate ACK by master after transfer;IIC1C_MST = 0; // Slave mode actually;IIC1F = 0x99; // Set speed to 50kHz for Bus = 18.8743MHz;// 12.5k-&amp;gt;0x39; 50k-&amp;gt;0x99; 100k-&amp;gt;0x59;IIC1S_SRW = 0; // R/W bit = 0;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;Doesn't make much sense to keep the module in slave mode when trying to use it as master.&amp;nbsp; Same thing with the SRW bit.&lt;BR /&gt;&lt;BR /&gt;Anyone successfully using the I2C module?&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 02:35:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130522#M2497</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-10-19T02:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08GB I2C Help</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130523#M2498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi irob,&lt;BR /&gt;&lt;BR /&gt;Where are you reading this code is for master ?&lt;BR /&gt;&lt;BR /&gt;This AppNote currently on the web introduces the code you wrote by:&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;3.1 Initialization of the IIC&lt;BR /&gt;The main task is to set the right speed of the SCL clock signal. These clocks are based on the bus frequency.&lt;BR /&gt;The next task is to set the IIC module functionality — to use or not use the interrupt service routine,&lt;BR /&gt;activate the IIC module, and set the slave mode. Refer to Example 1, Example 2, and Example 3.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;For me, that means clearly slave, and so does the comment associated...&lt;BR /&gt;May you please point where the mistake is so it can be modified ?&lt;BR /&gt;&lt;BR /&gt;I used I2C on S12 mainly but also on HC08.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Alban.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 04:18:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130523#M2498</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2007-10-19T04:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08GB I2C Help</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130524#M2499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hmm, you seem to be correct, Alban.&amp;nbsp; I guess I was inferring that all of those examples were for master mode for a couple reasons:&lt;BR /&gt;&lt;BR /&gt;1) Page one discusses:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;I&gt;This application note summarizes the common IIC bus&lt;BR /&gt;states and definitions and provides an example of how to&lt;BR /&gt;communicate with serial EEPROMs&lt;/I&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;/DIV&gt;That seems to imply master mode.&lt;BR /&gt;&lt;BR /&gt;2) The later examples of the code discuss the next steps -- write byte, read byte, etc.&amp;nbsp; In those examples, the master mode bits are all changed to master.&lt;BR /&gt;&lt;BR /&gt;It's not made very clear why the module has to be initialized first in a slave mode then changed.&amp;nbsp; Does this mean it must be changed back and forth between successive byte reads/writes?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by irob on &lt;SPAN class="date_text"&gt;2007-10-18&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:29 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 04:29:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130524#M2499</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-10-19T04:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08GB I2C Help</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130525#M2500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;My understanding of the operation of the IIC module is that, the MST control bit must be written with a 1 for the master to output a start condition, and then subsequently written with a 0 to output the stop condition.&amp;nbsp; Clearing the MST bit between transactions&amp;nbsp;also allows for the possibility of multiple master operation.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;For the example code&amp;nbsp;given in AN3291, it doesn't appear necessary to disable and re-enable the IIC module prior to each master write sequence, nor does it appear necessary to provide a delay following&amp;nbsp;a start condition.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2007 11:15:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HCS08GB-I2C-Help/m-p/130525#M2500</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-10-19T11:15:15Z</dc:date>
    </item>
  </channel>
</rss>

