<?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 Understanding InternalI2C in Processor Expert Software</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201925#M779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am, for the first time, setting up I2C communications to a couple of devices - an MPL115A2 barometer and a Sensiron SHT21 humidity/temperature sensor. Other devices will follow as soon as I have got my head around how this bean works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking through AN3785 for the barometer and example code for the Sensiron part, I am unable to fully reconcile I2C operations with the methods of the InternalI2C bean. Specifically, I can't see how or when a start is sent. I've found that I can send stops manually using SendStop - once I finally located the "Automatic stop condition" in the Advanced view of the Component Inspector. But how do I send a start at the appropriate point? Here's an example from the Sensiron documentation, which I just happen to have open:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I2c_StartCondition();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;error |= I2c_WriteByte (I2C_ADR_W);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;error |= I2c_WriteByte (USER_REG_R);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I2c_StartCondition();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;error |= I2c_WriteByte (I2C_ADR_R);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;*pRegisterValue = I2c_ReadByte(ACK);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;checksum=I2c_ReadByte(NO_ACK);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;error |= SHT2x_CheckCrc (pRegisterValue,1,checksum);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I2c_StopCondition();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Easy to see how the functions above map to InternalI2C methods, other than the start condition - of which I can't find a mention in the online documentation. The starts are specified at very specific points but - and I need to know how to make this happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also can't figure out the [Restart] in the AN3785, but am assuming this just means send a start again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Dec 2012 02:01:41 GMT</pubDate>
    <dc:creator>Smiffytech</dc:creator>
    <dc:date>2012-12-10T02:01:41Z</dc:date>
    <item>
      <title>Understanding InternalI2C</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201925#M779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am, for the first time, setting up I2C communications to a couple of devices - an MPL115A2 barometer and a Sensiron SHT21 humidity/temperature sensor. Other devices will follow as soon as I have got my head around how this bean works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking through AN3785 for the barometer and example code for the Sensiron part, I am unable to fully reconcile I2C operations with the methods of the InternalI2C bean. Specifically, I can't see how or when a start is sent. I've found that I can send stops manually using SendStop - once I finally located the "Automatic stop condition" in the Advanced view of the Component Inspector. But how do I send a start at the appropriate point? Here's an example from the Sensiron documentation, which I just happen to have open:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I2c_StartCondition();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;error |= I2c_WriteByte (I2C_ADR_W);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;error |= I2c_WriteByte (USER_REG_R);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I2c_StartCondition();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;error |= I2c_WriteByte (I2C_ADR_R);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;*pRegisterValue = I2c_ReadByte(ACK);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;checksum=I2c_ReadByte(NO_ACK);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;error |= SHT2x_CheckCrc (pRegisterValue,1,checksum);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;I2c_StopCondition();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Easy to see how the functions above map to InternalI2C methods, other than the start condition - of which I can't find a mention in the online documentation. The starts are specified at very specific points but - and I need to know how to make this happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also can't figure out the [Restart] in the AN3785, but am assuming this just means send a start again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 02:01:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201925#M779</guid>
      <dc:creator>Smiffytech</dc:creator>
      <dc:date>2012-12-10T02:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding InternalI2C</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201926#M780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please find below the detailed steps to resolve your issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;I2c_StartCondition();&lt;/P&gt;&lt;P&gt;error |= I2c_WriteByte (I2C_ADR_W);&lt;/P&gt;&lt;P&gt;The start (repeat start) condition and slave device address are set automatically within SendBlock (SendChar) method(s).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;error |= I2c_WriteByte (USER_REG_R);&lt;/P&gt;&lt;P&gt;The register content is filled via the passed parameter of SendBlock (SendChar) method(s).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;I2c_StartCondition();&lt;/P&gt;&lt;P&gt;error |= I2c_WriteByte (I2C_ADR_R);&lt;/P&gt;&lt;P&gt;*pRegisterValue = I2c_ReadByte(ACK);&lt;/P&gt;&lt;P&gt;checksum=I2c_ReadByte(NO_ACK);&lt;/P&gt;&lt;P&gt;Use RecvBlock method with Siz parameter set to value 2 to do this job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;I2c_StopCondition();&lt;/P&gt;&lt;P&gt;Use corresponding method from I2C component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;Do not forget to fill the correct value of I2C_ADR_W in the "Target slave address init" property in I2C component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Vojtech Filip&lt;/P&gt;&lt;P&gt;Processor Expert Support Team&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:48:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201926#M780</guid>
      <dc:creator>vfilip</dc:creator>
      <dc:date>2012-12-11T15:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding InternalI2C</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201927#M781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the explanation. Now that I've got a mapping between the documentation and the PEx methods, it should all make sense when I code this up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 19:47:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201927#M781</guid>
      <dc:creator>Smiffytech</dc:creator>
      <dc:date>2012-12-11T19:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding InternalI2C</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201928#M782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been doing a little research and think I fully understand the situation and my concerns are now addressed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was under the impression that starts needed to be seen at specific times, but it appears that multiple starts are permissible, and should be understood by slave devices.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My concern had been that, if every SendBlock/SendChar was sending a start condition first, this might cause problems with the slave, if it was not expecting these extra starts. Now I think this would only be the case if the slave were implementing the protocol incorrectly :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 21:48:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Understanding-InternalI2C/m-p/201928#M782</guid>
      <dc:creator>Smiffytech</dc:creator>
      <dc:date>2012-12-11T21:48:55Z</dc:date>
    </item>
  </channel>
</rss>

