<?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 FRDM-xxxx I2C Accelerometer question in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321043#M342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am trying to learn my way through the FRDM-KE02Z board using Kinetis Design Studio.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For this set of experiments, I am trying to communicate (I2C) with the on-board accelerometer (MMA8451Q).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Currently, I am trying to debug through consoleIO using printf, and this bit seems to work fine.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; However, it would appear that I am doing something horribly wrong in the way I am trying to communicate with the I2C module...&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Since I'm using the processor expert "beans," I guess I need to supply some background, so here goes:&lt;/P&gt;&lt;P&gt;~~~~~~~&amp;nbsp; CPU settings&amp;nbsp; ~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;CPU type: MKE02Z64VLH2 (yes, I know this is incorrect, but KDS won't let me select the VQH2 option)&lt;/P&gt;&lt;P&gt;Interrupts enabled&lt;/P&gt;&lt;P&gt;watchdog disabled&lt;/P&gt;&lt;P&gt;clock: 10MHz external crystal&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Internal peripherals:&lt;/P&gt;&lt;P&gt;NMI disabled&lt;/P&gt;&lt;P&gt;Reset pin enabled&lt;/P&gt;&lt;P&gt;Flash config field disabled&lt;/P&gt;&lt;P&gt;MCM setting not selected&lt;/P&gt;&lt;P&gt;LVD module not selected&lt;/P&gt;&lt;P&gt;Clock Gating not selected&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All CPU interrupts/resets disabled&lt;/P&gt;&lt;P&gt;Low power settings not selected&lt;/P&gt;&lt;P&gt;Clock config : ~16.8MHz bus/core clock&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;I have added also an internal I2C component (named Accelerometer)&lt;/P&gt;&lt;P&gt;This component uses I2C0 in Master mode, with an internal freq of ~4.2MHz&lt;/P&gt;&lt;P&gt;frequency divider bits give an SCL freq of ~95kHz with an SDA hold time of ~2.6us&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using this component both with, and without the Interrupt service event enabled.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The device is set up for 7-bit addressing and high speed mode.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~~~~~~~~~&amp;nbsp; Code&amp;nbsp; (Major comments removed)~~~~~~~~~~~~~~&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* MODULE main */&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Including needed modules to compile this module/procedure */&lt;/P&gt;&lt;P&gt;#include "Cpu.h"&lt;/P&gt;&lt;P&gt;#include "Events.h"&lt;/P&gt;&lt;P&gt;#include "CsIO.h"&lt;/P&gt;&lt;P&gt;#include "IO1.h"&lt;/P&gt;&lt;P&gt;#include "Accelerometer.h"&lt;/P&gt;&lt;P&gt;#include "IntI2cLdd1.h"&lt;/P&gt;&lt;P&gt;/* Including shared modules, which are used for whole project */&lt;/P&gt;&lt;P&gt;#include "PE_Types.h"&lt;/P&gt;&lt;P&gt;#include "PE_Error.h"&lt;/P&gt;&lt;P&gt;#include "PE_Const.h"&lt;/P&gt;&lt;P&gt;#include "IO_Map.h"&lt;/P&gt;&lt;P&gt;/* User includes (#include below this line is not maintained by Processor Expert) */&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*lint -save&amp;nbsp; -e970 Disable MISRA rule (6.3) checking. */&lt;/P&gt;&lt;P&gt;int main(void)&lt;/P&gt;&lt;P&gt;/*lint -restore Enable MISRA rule (6.3) checking. */&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your local variable definition here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AData[7] = {0,1,2,3,4,5,6};&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; Funny initialization for troubleshooting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned short&amp;nbsp;&amp;nbsp;&amp;nbsp; status = 0x55;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; short&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xG = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; short&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yG = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; short&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zG = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; word&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bytes = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int&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; error = 58;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; PE_low_level_init();&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** End of Processor Expert internal initialization.&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; ***/&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your code here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; error = Accelerometer_Enable();&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; enable the accelerometer&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = Accelerometer_SelectSlave(0x1D);&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; accelerometer address is 0x1D&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = Accelerometer_SendChar(0x40);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; reset the accelerometer&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = Accelerometer_SendChar(0x00);&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; Send start address&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = Accelerometer_RecvBlock(AData, 7, &amp;amp;bytes);&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; read back 7 bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = Accelerometer_RecvChar(&amp;amp;bytes);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = AData[0];&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xG = (AData[1]&amp;lt;&amp;lt;8) + AData[2];&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yG = (AData[3]&amp;lt;&amp;lt;8) + AData[4];&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zG = (AData[5]&amp;lt;&amp;lt;8) + AData[6];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xG = AData[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yG = AData[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zG = AData[5];&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Err:%3d BytesRX:%3d Status:%3d X:%6d Y:%6d Z:%6d\r\n", error, bytes, status, xG, yG, zG);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Don't write any code pass this line, or it will be deleted during code generation. ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; #ifdef PEX_RTOS_START&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PEX_RTOS_START();&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; /* Startup of the selected RTOS. Macro is defined by the RTOS component. */&lt;/P&gt;&lt;P&gt;&amp;nbsp; #endif&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** End of RTOS startup code.&amp;nbsp; ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;){}&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;/P&gt;&lt;P&gt;} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~~~~~~~~~~~~~~~~~~~&amp;nbsp; END CODE&amp;nbsp; ~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running this results in the following output:&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7 BytesRX:&amp;nbsp; 0 Status:&amp;nbsp; 0 X:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 Y:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 Z:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error 7 seems to be "ERR_DISABLED"&amp;nbsp; ???&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yesterday evening, I also saw a an error 12 "ERR_BUSOFF" ??&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any clues?&amp;nbsp; Help, please?&amp;nbsp; Probably something simple I'm missing, but I'd sure like to get it sorted out.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jun 2014 17:35:17 GMT</pubDate>
    <dc:creator>tomii</dc:creator>
    <dc:date>2014-06-18T17:35:17Z</dc:date>
    <item>
      <title>FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321043#M342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am trying to learn my way through the FRDM-KE02Z board using Kinetis Design Studio.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For this set of experiments, I am trying to communicate (I2C) with the on-board accelerometer (MMA8451Q).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Currently, I am trying to debug through consoleIO using printf, and this bit seems to work fine.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; However, it would appear that I am doing something horribly wrong in the way I am trying to communicate with the I2C module...&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Since I'm using the processor expert "beans," I guess I need to supply some background, so here goes:&lt;/P&gt;&lt;P&gt;~~~~~~~&amp;nbsp; CPU settings&amp;nbsp; ~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;CPU type: MKE02Z64VLH2 (yes, I know this is incorrect, but KDS won't let me select the VQH2 option)&lt;/P&gt;&lt;P&gt;Interrupts enabled&lt;/P&gt;&lt;P&gt;watchdog disabled&lt;/P&gt;&lt;P&gt;clock: 10MHz external crystal&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Internal peripherals:&lt;/P&gt;&lt;P&gt;NMI disabled&lt;/P&gt;&lt;P&gt;Reset pin enabled&lt;/P&gt;&lt;P&gt;Flash config field disabled&lt;/P&gt;&lt;P&gt;MCM setting not selected&lt;/P&gt;&lt;P&gt;LVD module not selected&lt;/P&gt;&lt;P&gt;Clock Gating not selected&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All CPU interrupts/resets disabled&lt;/P&gt;&lt;P&gt;Low power settings not selected&lt;/P&gt;&lt;P&gt;Clock config : ~16.8MHz bus/core clock&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;I have added also an internal I2C component (named Accelerometer)&lt;/P&gt;&lt;P&gt;This component uses I2C0 in Master mode, with an internal freq of ~4.2MHz&lt;/P&gt;&lt;P&gt;frequency divider bits give an SCL freq of ~95kHz with an SDA hold time of ~2.6us&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using this component both with, and without the Interrupt service event enabled.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The device is set up for 7-bit addressing and high speed mode.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~~~~~~~~~&amp;nbsp; Code&amp;nbsp; (Major comments removed)~~~~~~~~~~~~~~&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* MODULE main */&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Including needed modules to compile this module/procedure */&lt;/P&gt;&lt;P&gt;#include "Cpu.h"&lt;/P&gt;&lt;P&gt;#include "Events.h"&lt;/P&gt;&lt;P&gt;#include "CsIO.h"&lt;/P&gt;&lt;P&gt;#include "IO1.h"&lt;/P&gt;&lt;P&gt;#include "Accelerometer.h"&lt;/P&gt;&lt;P&gt;#include "IntI2cLdd1.h"&lt;/P&gt;&lt;P&gt;/* Including shared modules, which are used for whole project */&lt;/P&gt;&lt;P&gt;#include "PE_Types.h"&lt;/P&gt;&lt;P&gt;#include "PE_Error.h"&lt;/P&gt;&lt;P&gt;#include "PE_Const.h"&lt;/P&gt;&lt;P&gt;#include "IO_Map.h"&lt;/P&gt;&lt;P&gt;/* User includes (#include below this line is not maintained by Processor Expert) */&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*lint -save&amp;nbsp; -e970 Disable MISRA rule (6.3) checking. */&lt;/P&gt;&lt;P&gt;int main(void)&lt;/P&gt;&lt;P&gt;/*lint -restore Enable MISRA rule (6.3) checking. */&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your local variable definition here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AData[7] = {0,1,2,3,4,5,6};&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; Funny initialization for troubleshooting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned short&amp;nbsp;&amp;nbsp;&amp;nbsp; status = 0x55;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; short&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xG = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; short&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yG = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; short&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zG = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; word&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bytes = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int&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; error = 58;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; PE_low_level_init();&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** End of Processor Expert internal initialization.&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; ***/&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your code here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; error = Accelerometer_Enable();&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; enable the accelerometer&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = Accelerometer_SelectSlave(0x1D);&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; accelerometer address is 0x1D&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = Accelerometer_SendChar(0x40);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; reset the accelerometer&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = Accelerometer_SendChar(0x00);&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; Send start address&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = Accelerometer_RecvBlock(AData, 7, &amp;amp;bytes);&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; read back 7 bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = Accelerometer_RecvChar(&amp;amp;bytes);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Err:%3d \r\n", error);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = AData[0];&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xG = (AData[1]&amp;lt;&amp;lt;8) + AData[2];&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yG = (AData[3]&amp;lt;&amp;lt;8) + AData[4];&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zG = (AData[5]&amp;lt;&amp;lt;8) + AData[6];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xG = AData[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yG = AData[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zG = AData[5];&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Err:%3d BytesRX:%3d Status:%3d X:%6d Y:%6d Z:%6d\r\n", error, bytes, status, xG, yG, zG);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Don't write any code pass this line, or it will be deleted during code generation. ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; #ifdef PEX_RTOS_START&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PEX_RTOS_START();&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; /* Startup of the selected RTOS. Macro is defined by the RTOS component. */&lt;/P&gt;&lt;P&gt;&amp;nbsp; #endif&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** End of RTOS startup code.&amp;nbsp; ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;){}&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;/P&gt;&lt;P&gt;} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~~~~~~~~~~~~~~~~~~~&amp;nbsp; END CODE&amp;nbsp; ~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running this results in the following output:&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Err:&amp;nbsp; 7 BytesRX:&amp;nbsp; 0 Status:&amp;nbsp; 0 X:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 Y:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 Z:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error 7 seems to be "ERR_DISABLED"&amp;nbsp; ???&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yesterday evening, I also saw a an error 12 "ERR_BUSOFF" ??&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any clues?&amp;nbsp; Help, please?&amp;nbsp; Probably something simple I'm missing, but I'd sure like to get it sorted out.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 17:35:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321043#M342</guid>
      <dc:creator>tomii</dc:creator>
      <dc:date>2014-06-18T17:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321044#M343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attachments you can find a sample project which I migrated from CodeWarrior 10.6 to Kinetis Design Studio and for the FRDM-KL25 to the FRDM-KE02Z. The core is configured in FEI mode,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The application is getting data from the accelerometer and use this data to modulate PWM outputs through the RGB leds. Please check the example to have a better understanding of the Accelerometer device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this information can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. It would be nice!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 17:02:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321044#M343</guid>
      <dc:creator>adriancano</dc:creator>
      <dc:date>2014-06-20T17:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321045#M344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hahah!&amp;nbsp; Thank you, this is exactly what I was trying to do!&amp;nbsp; I just downloaded the code and am perusing it now.&amp;nbsp; Hopefully, it answers my questions!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 12:53:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321045#M344</guid>
      <dc:creator>tomii</dc:creator>
      <dc:date>2014-06-23T12:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321046#M345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me ask a stupid question real quick, as I can't quite seem to figure it out.&amp;nbsp; In KDS, how do you open up a project that's not in the workspace?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 13:25:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321046#M345</guid>
      <dc:creator>tomii</dc:creator>
      <dc:date>2014-06-23T13:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321047#M346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Menu&lt;/P&gt;&lt;P&gt;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 13:29:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321047#M346</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2014-06-23T13:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321048#M347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course, I finally figured it out just as I got your update.&amp;nbsp; D'oh!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 13:42:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321048#M347</guid>
      <dc:creator>tomii</dc:creator>
      <dc:date>2014-06-23T13:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321049#M348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I've been perusing your code, and I noticed something interesting - at least I think I did...&amp;nbsp; Actually, now that I look at it, it makes sense, and I realize that I thoroughly &lt;EM&gt;misread&lt;/EM&gt; the contectual help, etc...&amp;nbsp; So, I'll go ahead and post my ramblings here in the hopes that they'll help someone else...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in common.h, the following data structure is declared:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="common.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43012iA02C8DE99319E8E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="common.jpg" alt="common.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Fine and dandy.&amp;nbsp; I also see that the events generated on block sent/received "twiddle" this data structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43650i420A662274AC117E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also fine and dandy, as we like our semaphores to tell us when things are done (especially when they're asynchronous), right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, looking at main.c, I see that a structure of the TDataState is declared (DataState)... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42604i71783E78A9C21628/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I find interesting is that the pointer to this variable is handed to the init function...&amp;nbsp; When I read the context-sensitive help on this function, it gives the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/44426i76FCFEC4CA19DCF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I misread this such that I thought the pointer to be handed in was the pointer referenced in the Auto-Initialization contextual help below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/44580i8A6A4CC5EE4F149A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand, now, why things were not working correctly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, to put the use of this particular component (and likely many others) succinctly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) PointerToMyData = &amp;amp;MyData;&amp;nbsp;&amp;nbsp; //&amp;nbsp; (sort of)&lt;/P&gt;&lt;P&gt;2) DeviceDataPointer = Device_Init( PointerToMyData );&lt;/P&gt;&lt;P&gt;3) Device_MasterSendBlock( DeviceDataPointer, DataPointer, NumBytes, &amp;lt;pertinent parameters&amp;gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Izzat about right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, another question:&amp;nbsp; Must the data be handed into the Send/Receive function in order for the Device_On...BlockSent/Received events to work on them, or is there another way to hand the data into those functions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I'm having some trouble figuring out this last piece (I think it's the last, anyway) - If I were to select the "Auto Init" box, what is the component name?&amp;nbsp; does it remain the default name, or if I use the advanced properties to rename my I2C to "Accel" (for instance), would the device pointer become "Accel_DeviceData"&amp;nbsp; ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any advantages to using the Auto Init over not using it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One last thing (maybe), what are the ramifications to all this if I were to try to use polled mode, rather than interrupts?&amp;nbsp; How do you do the checking that the data has been TXd/RXd - just check the state of the buffers?&amp;nbsp; If that's the correct thinking, would I need to flush the buffers once the send/receive function has completed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 12:25:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321049#M348</guid>
      <dc:creator>tomii</dc:creator>
      <dc:date>2014-06-24T12:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321050#M349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Last question(s) (for the moment):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Even though I have not checked "auto init," my init function/method is still greyed out.&amp;nbsp; I can still use it in code (I think), but I'm curious about any ramifications...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43651i0FACB8CC4B70407C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) In the examples that were attached, I see that "CheckBus" is used.&amp;nbsp; Is this necessary?&amp;nbsp; Should the bus be idle when the OnMasterBlockSent event is called?&amp;nbsp; Or is this something for general transportability to a system that might be multitasking, etc, as a sort of semaphore between competing threads (and if so, wouldn't it make sense to set up a semaphore just for that?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 14:27:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321050#M349</guid>
      <dc:creator>tomii</dc:creator>
      <dc:date>2014-06-24T14:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321051#M350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answering to your questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Q: Must the data be handed into the Send/Receive function in order for the Device_On...BlockSent/Received events to work on them, or is there another way to hand the data into those functions?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;A: Since the I2C protocol is handled by frames it is better in Processor Expert to handle all the receive and send frames with this two function which handle the coming and going blocks. Also this function handle the interrupts and check the bus traffic. For me, this is the best way to use the module using Processor Expert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Q: If I were to select the "Auto Init" box, what is the component name?&amp;nbsp; does it remain the default name, or if I use the advanced properties to rename my I2C to "Accel" (for instance), would the device pointer become "Accel_DeviceData"&amp;nbsp; ??&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;A: If you select the Auto initialization the module will be initializated in the PE_low_level_init and a pointer to the component will be created in the .h file of the component; and every time you need to point to the component in any of it method you need to use this pointer. You can see this in the image below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="auto initialization.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/44422i0DCC5268686CFE85/image-size/large?v=v2&amp;amp;px=999" role="button" title="auto initialization.png" alt="auto initialization.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To select auto initialization or not will depend on your application for some reasons:&lt;/P&gt;&lt;P&gt;1. If you want to create your own pointer to the component then do not select auto initialization.&lt;/P&gt;&lt;P&gt;2. If you want or need to initializates the component in other part of your code that is not the PE_low_level_init function then do not select auto initialization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Q: what are the ramifications to all this if I were to try to use polled mode, rather than interrupts?&amp;nbsp; How do you do the checking that the data has been TXd/RXd - just check the state of the buffers?&amp;nbsp; If that's the correct thinking, would I need to flush the buffers once the send/receive function has completed?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;A: Here is where you have to say we are lucky to have Processor Expert on our side. You can check that if we do not check the Interrupt service box a new method is generated, this is the method &lt;STRONG&gt;Main. &lt;/STRONG&gt; You can see this method has the complete sequence to handle the I2C protocol without interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this information solve your queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 02:15:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321051#M350</guid>
      <dc:creator>adriancano</dc:creator>
      <dc:date>2014-06-25T02:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-xxxx I2C Accelerometer question</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321052#M351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answering to your questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Q: Even though I have not checked "auto init," my init function/method is still greyed out.&amp;nbsp; I can still use it in code (I think), but I'm curious about any ramifications...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;A: This init method is greyed out and also have a check mark because it indicates that this is a method you can not select if you want to generate or not the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Q: In the examples that were attached, I see that "CheckBus" is used.&amp;nbsp; Is this necessary?&amp;nbsp; Should the bus be idle when the OnMasterBlockSent event is called?&amp;nbsp; Or is this something for general transportability to a system that might be multitasking, etc, as a sort of semaphore between competing threads (and if so, wouldn't it make sense to set up a semaphore just for that?)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;A: In this example is no more than a security measure; in the step before the checkbus we check if the data is sent but we want also to check if the buss is now free to start another transmission. In some other application can be used as you say.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 02:22:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/FRDM-xxxx-I2C-Accelerometer-question/m-p/321052#M351</guid>
      <dc:creator>adriancano</dc:creator>
      <dc:date>2014-06-25T02:22:59Z</dc:date>
    </item>
  </channel>
</rss>

