<?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: M5213EVB I2C data I/O register problems in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5213EVB-I2C-data-I-O-register-problems/m-p/206987#M9883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;The I2C module can be connected to one of two different sets of physical pins (or not connected at all if you're not using it - you might need the pins for something else). The choice is made through the Pin Assignment registers.&lt;BR /&gt;&lt;BR /&gt;Obviously you need to choose the mapping which matches how you've actually wired up the I2C port to the processor.&lt;BR /&gt;&lt;BR /&gt;The reason that Pin Assignment Registers are needed is because there are more possible sources of signals from the processor modules (UARTs, timers, GPIO, I2C, etc, etc), than there are pins. It's not possible to use all of the modules on a ColdFire processor at the same time.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this clears up the mystery&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Mar 2008 21:05:49 GMT</pubDate>
    <dc:creator>SimonMarsden_de</dc:creator>
    <dc:date>2008-03-31T21:05:49Z</dc:date>
    <item>
      <title>M5213EVB I2C data I/O register problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5213EVB-I2C-data-I-O-register-problems/m-p/206985#M9881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;Hi everyone, I've just started messing with I2C and i seem to have run into a little problem, For some reason I cannot write to the I2DR register. I've used the driver example given by Dr Seuss with a change in I2C pins to :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;/* I2C pins configuration */&lt;BR /&gt;&amp;nbsp;MCF_GPIO_PASPAR |= ( MCF_GPIO_PASPAR_PASPAR0(0x01)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | MCF_GPIO_PASPAR_PASPAR1(0x01));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;My next step was setting up the I2C for transmit because I needed to transmitt the id of the device like so:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;uint8 I2CreceivedByte(uint8 address, uint8 id)&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;int i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;uint8 data;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;MCF_I2C_I2CR = 0xB0 ;&amp;nbsp;&amp;nbsp;//enable I2C set to master transmit mode&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; MCF_I2C_I2DR =&amp;nbsp; 0xC0; //set the id to the I/O register&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;I was watching the registers while running the program in debug mode. From what I observed the I2DR register never gets the id. I'm not exactly sure what is wrong however&amp;nbsp;I feel like i'm missing something. The following is what my registers look like up to this line of code.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;/*I2C Registers*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;I2ADR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;I2FDR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x32&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;I2CR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;0xB0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;I2SR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x81&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;I2DR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;/*General Purpose I/O Port AS Registers*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;PORTAS&amp;nbsp; 0x03&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;DDRAS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x00&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;SETAS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x03&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;CLRAS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;PASPAR&amp;nbsp; 0x05&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 2;"&gt;Thanks in advance for any helps or hints anyone can give me&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2008 22:59:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5213EVB-I2C-data-I-O-register-problems/m-p/206985#M9881</guid>
      <dc:creator>jrowland</dc:creator>
      <dc:date>2008-03-27T22:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: M5213EVB I2C data I/O register problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5213EVB-I2C-data-I-O-register-problems/m-p/206986#M9882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;FONT size="2"&gt;Looking at the sample code for the I2C module for the M5213EVB it turns out that I was using/initializing the wrong port. I turns out that I needed to use PORT QS correcting my initialization to :&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;/* I2C pins configuration */&lt;BR /&gt;&amp;nbsp;MCF_GPIO_PQSPAR = 0 | ( MCF_GPIO_PQSPAR_P&lt;/FONT&gt;&lt;FONT size="2"&gt;QS&lt;/FONT&gt;&lt;FONT size="2"&gt;PAR3(2)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | MCF_GPIO_P&lt;/FONT&gt;&lt;FONT size="2"&gt;QS&lt;/FONT&gt;&lt;FONT size="2"&gt;PAR_P&lt;/FONT&gt;&lt;FONT size="2"&gt;QS&lt;/FONT&gt;&lt;FONT size="2"&gt;PAR2(2));&lt;BR /&gt;&lt;BR /&gt;In doing this I am finally able to change the I2DR register value. What I don't understand is from looking at the MCF5213 Reference Manual it mentions that Port AS has SDA and SCL . Does this mean that both Port AS and Port QS have I2C SDA and SCL ports? If so, why could I not modifiy the I2DR register when setting the Port AS? Thanks in advance for any information that can help me clear up this confusion.&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by jrowland on &lt;SPAN class="date_text"&gt;2008-03-28&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:50 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Mar 2008 01:49:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5213EVB-I2C-data-I-O-register-problems/m-p/206986#M9882</guid>
      <dc:creator>jrowland</dc:creator>
      <dc:date>2008-03-29T01:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: M5213EVB I2C data I/O register problems</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5213EVB-I2C-data-I-O-register-problems/m-p/206987#M9883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;The I2C module can be connected to one of two different sets of physical pins (or not connected at all if you're not using it - you might need the pins for something else). The choice is made through the Pin Assignment registers.&lt;BR /&gt;&lt;BR /&gt;Obviously you need to choose the mapping which matches how you've actually wired up the I2C port to the processor.&lt;BR /&gt;&lt;BR /&gt;The reason that Pin Assignment Registers are needed is because there are more possible sources of signals from the processor modules (UARTs, timers, GPIO, I2C, etc, etc), than there are pins. It's not possible to use all of the modules on a ColdFire processor at the same time.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this clears up the mystery&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 21:05:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5213EVB-I2C-data-I-O-register-problems/m-p/206987#M9883</guid>
      <dc:creator>SimonMarsden_de</dc:creator>
      <dc:date>2008-03-31T21:05:49Z</dc:date>
    </item>
  </channel>
</rss>

