<?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: MCF51JM128+ Wii Motion Plus in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166692#M5836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've some research about it. &amp;nbsp;found that wire.h library on arduino, add a R/W bit after 7 bit control word, that's why there're some propertires for object Wire&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wire.begintransmission (xxxx): &amp;nbsp;sends R/W bit before xxxx&lt;/P&gt;&lt;P&gt;Wire.Send (xxxx) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : sends data as is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i got a example to control Wii motion plus with arduino from "any website jeje". &amp;nbsp; &amp;nbsp;to wake up the WMP sends 0X53 as a command, 0XFE as adress and 0X04 as data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then sends a zero (don't know why, but...) &amp;nbsp; starts with 0X52 as command, and 0X00 as data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to read data, sends 0X52 with R/W bit set as READ. &amp;nbsp;then, MCU should wait for 6 byte data, last byte followed by a Nack bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've tested this commands with the arduino.. works fine. &amp;nbsp;with JM128 not.!&lt;/P&gt;&lt;P&gt;there're some pull up resistors installed on both pins, SDA and SCL. &amp;nbsp;(10k). &amp;nbsp;i found in internet also that WMP has its own pull up's. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCU is working with 3.3v supply, so there's no needed any level shifter, and MCU pull ups are conected to MCU VDD.&lt;/P&gt;&lt;P&gt;trying to find the problem, i used a oscilloscope to see signal levels and shapes. &amp;nbsp;looks normal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2012 07:11:53 GMT</pubDate>
    <dc:creator>mauricio2346</dc:creator>
    <dc:date>2012-05-29T07:11:53Z</dc:date>
    <item>
      <title>MCF51JM128+ Wii Motion Plus</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166690#M5834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &amp;nbsp;i been trying to get gyro data from a Wii Motion Plus trough I2C module.&lt;/P&gt;&lt;P&gt;i get no response from the device, so i think i've made a mistake in configuration of IIC module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;this is how i configured the module. &amp;nbsp;baud rate is 400kbps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void IIC1_Init(void){&amp;nbsp; IIC1C1=0xC0;&amp;nbsp;&amp;nbsp;&amp;nbsp; //IIC habilitado, Interrupcion por IIC habilitada, Modo esclavo habilitado, transmision apagada,no hay recibido ACK,No se repite start.&amp;nbsp;&amp;nbsp; IIC1S=0x10;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Bandera transferencia en proceso, No direccionamiento a esclavo, bus ocupado, bus operando normal, master escribe esclavo recibe, no hay interrupciones, recibe ACK.&amp;nbsp; //IIC1F=0x1F;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Factor MULT: 1, rata de baudios 100KHz para WM+ (24Mhz/1*100Khz)=240=0x1F, 100Khz.&amp;nbsp; IIC1F=0x45;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Factor MULT: 2, rata de baudios 400KHz para WM+ (24Mhz/2*400Khz)=30=0x05, 400Khz.}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;start and stop condition procedures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void IIC1_StartBit(){&amp;nbsp; //while(IIC1S_BUSY);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //espere a que el IIC se desocupe&amp;nbsp; IIC1C_TX=1;&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; //habilite modo TX por el maestro&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; //se envia ACK&amp;nbsp; IIC1C_MST=1;&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; //modo maestro.}void IIC1_StopBit(void){&amp;nbsp; IIC1C = 0xC0;&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; //genere una condicion de STOP&amp;nbsp; //while(IIC1S_BUSY);&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; //espere a que el IIC se desocupe&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;writing condition:&lt;/P&gt;&lt;PRE&gt;void IIC1_PutChar(unsigned char Tx1_Data){&amp;nbsp; IIC1_Flag=0;&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; //Baje la bandera de atención a interrupción&amp;nbsp; IIC1D=Tx1_Data;&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; //Cargue dato a registro. while(!IIC1S_BUSY);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //espere a que el IIC se desocupe&amp;nbsp; while(IIC1S_IICIF);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //espere a que el modulo IIC no tenga interrupciones pendientes&amp;nbsp; //IIC1S &amp;amp;= ~0X02;&amp;nbsp;&amp;nbsp; IIC1S_IICIF=0;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and reading:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;unsigned char IIC1_GetChar(unsigned char Ack_Req){&amp;nbsp; unsigned char Dummy_Byte=0;&amp;nbsp; IIC1C_TX=0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Modo de recepcion. Dummy_Byte= IIC1D;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Lea dato de basura para despejar el buffer. while(IIC1S_IICIF);&amp;nbsp; //espere a que el modulo IIC no tenga interrupciones pendientes&amp;nbsp; //IIC1S &amp;amp;= ~0X02;&amp;nbsp;&amp;nbsp; IIC1S_IICIF=0;&amp;nbsp; if(Ack_Req){&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC1C_TXAK=0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Habilitar ACK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; else if (Ack_Req==0){&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC1C_TXAK=1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Deshabilitar ACK&amp;nbsp;&amp;nbsp; }&amp;nbsp; IIC1RX_Data=IIC1D;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //lea el dato solicitado&amp;nbsp; return(IIC1RX_Data);}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what do you think???&amp;nbsp;&lt;/P&gt;&lt;P&gt;main routine has the following structure:&lt;/P&gt;&lt;PRE&gt; IIC1_StartBit();&amp;nbsp;&amp;nbsp; IIC1_PutChar((0X53&amp;lt;&amp;lt;1)|I2C_WRITE); //Adressing&amp;nbsp;&amp;nbsp; IIC1_PutChar(0XFE);&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; //Register&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC1_PutChar(0X04);&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; //Register Value&amp;nbsp;&amp;nbsp; IIC1_StopBit();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;reading route looks like:&lt;/P&gt;&lt;PRE&gt;IIC1_StartBit();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC1_PutChar((0X52&amp;lt;&amp;lt;1)|I2C_READ);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC1_PutChar(0X00);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC1_StopBit();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i=0;i&amp;lt;5;i++){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dato[i]=IIC1_GetChar(1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dato[5]=IIC1_GetChar(0);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;what do you think? &amp;nbsp;does anybody have worked with Wii Motion Plus???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've tested a routime made for arduino with same structure, registers and data and works fine!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:14:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166690#M5834</guid>
      <dc:creator>mauricio2346</dc:creator>
      <dc:date>2020-10-29T09:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51JM128+ Wii Motion Plus</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166691#M5835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;IIC1_PutChar((0X53&amp;lt;&amp;lt;1)|I2C_WRITE); //Adressing...IIC1_PutChar((0X52&amp;lt;&amp;lt;1)|I2C_READ);&lt;/PRE&gt;&lt;P&gt;0x53 and 0x52. Is that intentional?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Warious references give the address as 0x52:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiibrew.org/wiki/Wiimote/Extension_Controllers" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;http://wiibrew.org/wiki/Wiimote/Extension_Controllers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has the code somehow confused the I2C_READ bit with the LSB of the address? I always get confused by the "7 bit address shifted left one and the read/write bit stuck on the bottom".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; i've tested a routime made for arduino with same structure, registers and data and works fine!!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can you look at the I2C bus with a CRO when driven by the Arduino and when driven by the ColdFire to see what's different?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check that you've got pullup resistors and they're low enough. If the signals look good on a CRO then this is OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:14:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166691#M5835</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2020-10-29T09:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51JM128+ Wii Motion Plus</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166692#M5836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've some research about it. &amp;nbsp;found that wire.h library on arduino, add a R/W bit after 7 bit control word, that's why there're some propertires for object Wire&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wire.begintransmission (xxxx): &amp;nbsp;sends R/W bit before xxxx&lt;/P&gt;&lt;P&gt;Wire.Send (xxxx) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : sends data as is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i got a example to control Wii motion plus with arduino from "any website jeje". &amp;nbsp; &amp;nbsp;to wake up the WMP sends 0X53 as a command, 0XFE as adress and 0X04 as data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then sends a zero (don't know why, but...) &amp;nbsp; starts with 0X52 as command, and 0X00 as data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to read data, sends 0X52 with R/W bit set as READ. &amp;nbsp;then, MCU should wait for 6 byte data, last byte followed by a Nack bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've tested this commands with the arduino.. works fine. &amp;nbsp;with JM128 not.!&lt;/P&gt;&lt;P&gt;there're some pull up resistors installed on both pins, SDA and SCL. &amp;nbsp;(10k). &amp;nbsp;i found in internet also that WMP has its own pull up's. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCU is working with 3.3v supply, so there's no needed any level shifter, and MCU pull ups are conected to MCU VDD.&lt;/P&gt;&lt;P&gt;trying to find the problem, i used a oscilloscope to see signal levels and shapes. &amp;nbsp;looks normal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 07:11:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166692#M5836</guid>
      <dc:creator>mauricio2346</dc:creator>
      <dc:date>2012-05-29T07:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51JM128+ Wii Motion Plus</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166693#M5837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom, i couldn't attach main.c file into las post, i don't know why.. anyway, i'v made some changes on the code, based on document AN3291. &amp;nbsp;&lt;/P&gt;&lt;P&gt;these are routines to read, write, start, restart and stop over IIC module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void IIC1_Init(void){  IIC1C_IICEN = 1; // Enable I2C;  IIC1C_IICIE = 1; // Enable I2C;  IIC1C_TXAK = 1; // not generate ACK by master after transfer;  IIC1C_MST = 0; // Slave mode actually;  //IIC1F=0x45;     //Factor MULT: 2, rata de baudios 400KHz para WM+ (24Mhz/2*400Khz)=30=0x05, 400Khz.  IIC1F=0x1F;     //Factor MULT: 1, rata de baudios 100KHz para WM+ (24Mhz/1*240Khz)=30=0x1F, 100Khz.  IIC1S_SRW = 0; // R/W bit = 0;}unsigned char IIC1_GetChar(unsigned char Ack){    if(Ack=0X00){    IIC1C_TXAK = 1; // acknowledge disable;  }   else if (Ack=0X01){    IIC1C_TXAK = 0; // acknowledge Enable;    }    IIC1C_TX = 0; // set up to receive;  IIC1RX_Data = IIC1D; // dummy read;  //while (!IIC1S_IICIF); // wait until IBIF;  while (IIC1S_IICIF); // wait until IBIF;  IIC1_StopBit();  IIC1RX_Data = IIC1D; // read right data;  return IIC1RX_Data;}void IIC1_PutChar(unsigned char Tx_Data){  IIC1D = Tx_Data;  //while (!IIC1S_IICIF); // wait until IBIF;  while (IIC1S_IICIF); // wait until IBIF;  IIC1S_IICIF=1; // clear the interrupt event flag;  //while(IIC1S_RXAK); // check for RXAK;   //while(IIC1S_BUSY); // check for RXAK;}  void IIC1_StartBit(){  IIC1C_TXAK = 0; // RX/TX = 1; MS/SL = 1; TXAK = 0;  IIC1C |= 0x30; // And generate START condition;}void IIC1_RepeatStart(void){  IIC1C_RSTA = 1; // set up repeated start;  }void IIC1_StopBit(void){  IIC1S_IICIF=1; // clear the interrupt event flag;  IIC1C_MST = 0; // generate STOP condition;   }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;as you can see, im making poling over some flags, like IICF. &amp;nbsp;i don't ready know why the example of document reads this flag like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;while (!IIC1S_IICIF); // wait until IBIF;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;it doesn't work.....&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im reading also on interrupt routine TCF, IAAS and ARBL flags. &amp;nbsp;every reading or reading cicle y always get a TCF confirmation (received data or command)....&lt;/P&gt;&lt;PRE&gt;#pragma TRAP_PROCvoid IIC1X_ISR(void) {  if(IIC1S_TCF){  //Se completó transferencia  Confirmacion=1;      }   else if (IIC1S_IAAS){  //direccionado como esclavo  Confirmacion=2;  }   else if (IIC1S_ARBL){  //Perdió Arbitramiento  Confirmacion=3;    }  IIC1S_IICIF=1;               //aclare bandera de interrupción  //IIC1S_IICIF!=IIC1S_IICIF;    //aclare bandera de interrupción    //State_Led=IIC1S_SRW;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;this is main routine. &amp;nbsp; as you can see, i added a restart command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void main(void) {     IIC1_Init();    EnableInterrupts;    DelayMs(100);//Wake up Wii Motion Plus    IIC1_StartBit();    IIC1_PutChar((0X53&amp;lt;&amp;lt;1)|I2C_WRITE);  //send 0XA6    IIC1_PutChar(0XFE);    IIC1_PutChar(0X04);    IIC1_StopBit();   //Send Zero to Wii Moiton Plus    IIC1_StartBit();    IIC1_PutChar((0X52&amp;lt;&amp;lt;1)|I2C_WRITE);  //Send 0XA5    IIC1_PutChar(0X00);    IIC1_StopBit();    //Calibrate zero for Wii Motion Plus.                       for (a=0;a&amp;lt;1;a++){//Send zeros again              IIC1_StartBit();       IIC1_PutChar((0X52&amp;lt;&amp;lt;1)|I2C_WRITE);  //Send 0XA4       IIC1_PutChar(0X00);       IIC1_RepeatStart();       IIC1_PutChar((0X52&amp;lt;&amp;lt;1)|I2C_READ);  //Send 0XA5               for (i=0;i&amp;lt;6;i++){                 Dato[i]=IIC1_GetChar();                               }              IIC1_StopBit();              yaw0+=(((Dato[3]&amp;gt;&amp;gt;2)&amp;lt;&amp;lt;8)+Dato[0])/10;                   pitch0+=(((Dato[4]&amp;gt;&amp;gt;2)&amp;lt;&amp;lt;8)+Dato[1])/10;              roll0+=(((Dato[5]&amp;gt;&amp;gt;2)&amp;lt;&amp;lt;8)+Dato[2])/10;                     }         for(;;) {//Enviar cero al Wii Moiton Plus      IIC1_StartBit();    IIC1_PutChar((0X52&amp;lt;&amp;lt;1)|I2C_WRITE);  //Send 0XA5    IIC1_PutChar(0X00);    IIC1_RepeatStart();    IIC1_PutChar((0X52&amp;lt;&amp;lt;1)|I2C_READ);  // Send 0XA6     for (i=0;i&amp;lt;6;i++){      Dato[i]=IIC1_GetChar();           }     IIC1_StopBit();      yaw=((Dato[3]&amp;gt;&amp;gt;2)&amp;lt;&amp;lt;8)+Dato[0]-yaw0;      pitch=((Dato[4]&amp;gt;&amp;gt;2)&amp;lt;&amp;lt;8)+Dato[1]-pitch0;      roll=((Dato[5]&amp;gt;&amp;gt;2)&amp;lt;&amp;lt;8)+Dato[2]-roll0;        State_Led=~State_Led;     DelayMs(300);   }}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;hope this information can help..&lt;/P&gt;&lt;P&gt;Regards;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:14:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166693#M5837</guid>
      <dc:creator>mauricio2346</dc:creator>
      <dc:date>2020-10-29T09:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: MCF51JM128+ Wii Motion Plus</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166694#M5838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I can't help by reading your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm runnng I2C on a different Freescale CPU, an MCF5329 anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started with this source:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/webapp/sps/download/license.jsp?colCode=MCF5282I2C&amp;amp;location=null&amp;amp;fsrch=1&amp;amp;sr=1&amp;amp;Parent_nodeId=from%20search&amp;amp;Parent_pageType=from%20search" rel="nofollow" target="_blank"&gt;http://www.freescale.com/webapp/sps/download/license.jsp?colCode=MCF5282I2C&amp;amp;location=null&amp;amp;fsrch=1&amp;amp;sr=1&amp;amp;Parent_nodeId=from%20search&amp;amp;Parent_pageType=from%20search&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That link may or may not work. Go to the normal Freescale site and search for "MCF5282I2C". Then download that and compare with your code. Since it is for a different CPU (V2 and not V1) the I2C controller may be the same, may be different and may have different #defines for the registers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still advise looking at working and not-working signals with a CRO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 11:12:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF51JM128-Wii-Motion-Plus/m-p/166694#M5838</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2012-05-29T11:12:55Z</dc:date>
    </item>
  </channel>
</rss>

