<?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: MCF5213EVB - I2C Problem in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5213EVB-I2C-Problem/m-p/141013#M2377</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The "Bus Busy" issue was because the missing of two pull-up resistors (I2C standard). I only have to change the jumpers on the EVB.&lt;BR /&gt;&lt;BR /&gt;But I am still not able to communicate with the camera.&lt;BR /&gt;&lt;BR /&gt;I slowed down the CF to a systemclock of 20 MHz. The resulting I2C frequency is round about 5 kHz, that should fit.&lt;BR /&gt;&lt;BR /&gt;The camera forced a protocol (read action) of:&lt;BR /&gt;Command-Block:&lt;BR /&gt;&amp;lt;START&amp;gt; i2c-adr &amp;lt;ACKN&amp;gt; R/W-Mode &amp;lt;ACKN&amp;gt; dev-adr &amp;lt;ACKN&amp;gt; reg-adr &amp;lt;ACKN&amp;gt; &amp;lt;STOP&amp;gt;&lt;BR /&gt;Data-Block:&lt;BR /&gt;&amp;lt;START&amp;gt; i2c-adr_R/W &amp;lt;ACKN&amp;gt; data &amp;lt;ACKN&amp;gt; NACKN&lt;BR /&gt;&lt;BR /&gt;And between the Comm-Block and the Data-Block have to be a break of at least 2 msec.&lt;BR /&gt;&lt;BR /&gt;I explain my code in words:&lt;BR /&gt;1. init (setting i2c-freq and i2c-slave adr.)&lt;BR /&gt;2. set I2CR to&amp;nbsp; " 0 | IEN | MSTA | MTX " (means: enable + master + transmit + "sends START" )&lt;BR /&gt;3. write to I2DR the "i2c-adr"&lt;BR /&gt;4. wait for IIF and RXAK&lt;BR /&gt;5. do step (3.) and (4.) with "R/W-Mode", "dev-adr", "reg-adr" (instead of "i2c-adr")&lt;BR /&gt;6. set I2CR to "0x80" (means: enable + slave + receive + "sends STOP")&lt;BR /&gt;7. set I2CR to "0x0" (disable I2C-Module; without that I later gain an "arbitration lost")&lt;BR /&gt;8. set wait for a bit ( int i = 1000000; while(i--); ) should be enough for 2msec&lt;BR /&gt;&lt;BR /&gt;I think my fault lies in the following lines.&lt;BR /&gt;9. do again step (2.) (IEN | MSTA | MTX)&lt;BR /&gt;10. do step (3.) with "i2c-adr_R/W"&lt;BR /&gt;11. do step (4.)&lt;BR /&gt;12. clear MTX (means: change to receive-mode)&lt;BR /&gt;13. read from I2DR (dummy read, but same variable as it is for real data)&lt;BR /&gt;14. do step (4.)&lt;BR /&gt;15. read from I2DR&lt;BR /&gt;16. do steps (6.) and (7.)&lt;BR /&gt;&lt;BR /&gt;But the variables that I use to move the content of I2DR always contain the "i2c-adr_R/W" even if I do steps (13.) and (14.) several times in a row.&lt;BR /&gt;&lt;BR /&gt;Please Help.&lt;BR /&gt;Thanx&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jul 2007 21:22:37 GMT</pubDate>
    <dc:creator>fiskom</dc:creator>
    <dc:date>2007-07-25T21:22:37Z</dc:date>
    <item>
      <title>MCF5213EVB - I2C Problem</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5213EVB-I2C-Problem/m-p/141012#M2376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the MCF5213EVB with a camera that can be controlled via I2C.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is, that this camera only supports a maximum I2C frequency of&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;10 kHz.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The ColdFire is running at 80 MHz and the maximum available divider for I2C frequency is&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"3840", if I correctly understand the Ref.Man. (Chapt. 22.5.2).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I gain is a minimum of 20.83 kHz prescaled I2C frequency, if I calculate right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats too much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any thinking fault or do I really have to slow down the whole CF to communicate with&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this camera?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The resulting problem (I think) is, that I always gain an "Bus Busy Interrupt" at initilization time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code is attached below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and please excuse my english&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by Alban on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-07-24&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;05:49 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 22:41:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5213EVB-I2C-Problem/m-p/141012#M2376</guid>
      <dc:creator>fiskom</dc:creator>
      <dc:date>2007-07-24T22:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: MCF5213EVB - I2C Problem</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5213EVB-I2C-Problem/m-p/141013#M2377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The "Bus Busy" issue was because the missing of two pull-up resistors (I2C standard). I only have to change the jumpers on the EVB.&lt;BR /&gt;&lt;BR /&gt;But I am still not able to communicate with the camera.&lt;BR /&gt;&lt;BR /&gt;I slowed down the CF to a systemclock of 20 MHz. The resulting I2C frequency is round about 5 kHz, that should fit.&lt;BR /&gt;&lt;BR /&gt;The camera forced a protocol (read action) of:&lt;BR /&gt;Command-Block:&lt;BR /&gt;&amp;lt;START&amp;gt; i2c-adr &amp;lt;ACKN&amp;gt; R/W-Mode &amp;lt;ACKN&amp;gt; dev-adr &amp;lt;ACKN&amp;gt; reg-adr &amp;lt;ACKN&amp;gt; &amp;lt;STOP&amp;gt;&lt;BR /&gt;Data-Block:&lt;BR /&gt;&amp;lt;START&amp;gt; i2c-adr_R/W &amp;lt;ACKN&amp;gt; data &amp;lt;ACKN&amp;gt; NACKN&lt;BR /&gt;&lt;BR /&gt;And between the Comm-Block and the Data-Block have to be a break of at least 2 msec.&lt;BR /&gt;&lt;BR /&gt;I explain my code in words:&lt;BR /&gt;1. init (setting i2c-freq and i2c-slave adr.)&lt;BR /&gt;2. set I2CR to&amp;nbsp; " 0 | IEN | MSTA | MTX " (means: enable + master + transmit + "sends START" )&lt;BR /&gt;3. write to I2DR the "i2c-adr"&lt;BR /&gt;4. wait for IIF and RXAK&lt;BR /&gt;5. do step (3.) and (4.) with "R/W-Mode", "dev-adr", "reg-adr" (instead of "i2c-adr")&lt;BR /&gt;6. set I2CR to "0x80" (means: enable + slave + receive + "sends STOP")&lt;BR /&gt;7. set I2CR to "0x0" (disable I2C-Module; without that I later gain an "arbitration lost")&lt;BR /&gt;8. set wait for a bit ( int i = 1000000; while(i--); ) should be enough for 2msec&lt;BR /&gt;&lt;BR /&gt;I think my fault lies in the following lines.&lt;BR /&gt;9. do again step (2.) (IEN | MSTA | MTX)&lt;BR /&gt;10. do step (3.) with "i2c-adr_R/W"&lt;BR /&gt;11. do step (4.)&lt;BR /&gt;12. clear MTX (means: change to receive-mode)&lt;BR /&gt;13. read from I2DR (dummy read, but same variable as it is for real data)&lt;BR /&gt;14. do step (4.)&lt;BR /&gt;15. read from I2DR&lt;BR /&gt;16. do steps (6.) and (7.)&lt;BR /&gt;&lt;BR /&gt;But the variables that I use to move the content of I2DR always contain the "i2c-adr_R/W" even if I do steps (13.) and (14.) several times in a row.&lt;BR /&gt;&lt;BR /&gt;Please Help.&lt;BR /&gt;Thanx&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 21:22:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5213EVB-I2C-Problem/m-p/141013#M2377</guid>
      <dc:creator>fiskom</dc:creator>
      <dc:date>2007-07-25T21:22:37Z</dc:date>
    </item>
  </channel>
</rss>

