<?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>8-bit MicrocontrollersのトピックRe: SPI Communication - MC9S08QG8 with accelerometer</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198922#M16115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Again, I used I2C. I'm not all that familiar with SPI transaction protocol. But in the I2C world, the format is: (for writing) Start Command 7-bit base address + !W bit (LSB) Register address Data Stop bit (for reading) Start Command 7-bit base address + !W bit (LSB) Register address to read from Start Command 7-bit base address + R bit (LSB) Data Stop bit&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 May 2010 04:49:15 GMT</pubDate>
    <dc:creator>irob</dc:creator>
    <dc:date>2010-05-11T04:49:15Z</dc:date>
    <item>
      <title>SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198919#M16112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using the following demo board, DEMO9S08QG8, that uses the MC9S08QG8 MCU and I'm trying to talk to a ST accelerometer via SPI,&amp;nbsp; Attached is the datasheet accelerometer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a lot of good existing information on the forums regarding SPI and even some application notes, but i would appreciate another set of eyes into what I could be doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to communicate w/ the device, i keep getting back 255 as the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached are some code snippets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;hidef.h&amp;gt; /* for EnableInterrupts macro */#include "derivative.h" /* include peripheral declarations */#ifdef __cplusplus extern "C"#endifvoid MCU_init(void); /* Device initialization function declaration */unsigned char memorydata = 0;unsigned char temp = 0;long int address = 0x0F;byte SPI_proc(byte data);void main(void) {&amp;nbsp; MCU_init(); /* call Device Initialization */&amp;nbsp; /* include your code here */&amp;nbsp; for(;;) {&amp;nbsp;&amp;nbsp;&amp;nbsp; /* __RESET_WATCHDOG(); by default, COP is disabled with device init. When enabling, also reset the watchdog. */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (PTAD_PTAD2 == 0)&amp;nbsp; /* read chip */&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD5 = 0;&amp;nbsp;&amp;nbsp; /* chip select low */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)SPI_proc(3);&amp;nbsp;&amp;nbsp;&amp;nbsp; /* send read instruction to memory */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memorydata = SPI_proc(0x0F);&amp;nbsp;&amp;nbsp;&amp;nbsp; /* red device id */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD5 = 1;&amp;nbsp;&amp;nbsp; /* chip select high */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } /* loop forever */&amp;nbsp; /* please make sure that you never leave main */&amp;nbsp; }}byte SPI_proc(byte data) {&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!SPIS_SPTEF); /* wait for tX buffer to empty */&amp;nbsp; SPID = data;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* send data */&amp;nbsp; while(!SPIS_SPRF);&amp;nbsp; /* wait for Rx buffer to empty */&amp;nbsp; return (SPID);}&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's MCU_init()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*** ===================================================================**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; MCU_init (bean MC9S08QG8_16)****&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description :**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Device initialization code for selected peripherals.** ===================================================================*/void MCU_init(void){&amp;nbsp; /* ### MC9S08QG8_16 "Cpu" init code ... */&amp;nbsp; /*&amp;nbsp; PE initialization code after reset */&amp;nbsp; /* Common initialization of the write once registers */&amp;nbsp; /* SOPT1: COPE=0,COPT=1,STOPE=0,BKGDPE=1,RSTPE=0 */&amp;nbsp; SOPT1 = 0x52;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* SPMSC1: LVDF=0,LVDACK=0,LVDIE=0,LVDRE=1,LVDSE=1,LVDE=1,BGBE=0 */&amp;nbsp; SPMSC1 = 0x1C;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* SPMSC2: PDF=0,PPDF=0,PPDACK=0,PDC=0,PPDC=0 */&amp;nbsp; SPMSC2 = 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;&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; /* SPMSC3: LVDV=0,LVWV=0 */&amp;nbsp; SPMSC3 &amp;amp;= (unsigned char)~0x30;&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; System clock initialization */&amp;nbsp; ICSTRM = *(unsigned char*far)0xFFAF; /* Initialize ICSTRM register from a non volatile memory */&amp;nbsp; ICSSC = *(unsigned char*far)0xFFAE;&amp;nbsp; /* Initialize ICSSC register from a non volatile memory */&amp;nbsp; /* ICSC1: CLKS=0,RDIV=0,IREFS=1,IRCLKEN=0,IREFSTEN=0 */&amp;nbsp; ICSC1 = 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Initialization of the ICS control register 1 */&amp;nbsp; /* ICSC2: BDIV=0,RANGE=0,HGO=0,LP=0,EREFS=0,ERCLKEN=0,EREFSTEN=0 */&amp;nbsp; ICSC2 = 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;&amp;nbsp; /* Initialization of the ICS control register 2 */&amp;nbsp; /* Common initialization of the CPU registers */&amp;nbsp; /* PTASE: PTASE4=1,PTASE3=1,PTASE2=1,PTASE1=1,PTASE0=1 */&amp;nbsp; PTASE |= (unsigned char)0x1F;&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; /* PTBSE: PTBSE7=1,PTBSE6=1,PTBSE5=1,PTBSE4=1,PTBSE3=1,PTBSE2=1,PTBSE1=1,PTBSE0=1 */&amp;nbsp; PTBSE = 0xFF;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* PTADS: PTADS5=0,PTADS4=0,PTADS3=0,PTADS2=0,PTADS1=0,PTADS0=0 */&amp;nbsp; PTADS = 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;&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; /* PTBDS: PTBDS7=0,PTBDS6=0,PTBDS5=0,PTBDS4=0,PTBDS3=0,PTBDS2=0,PTBDS1=0,PTBDS0=0 */&amp;nbsp; PTBDS = 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;&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; /* ### Init_SPI init code */&amp;nbsp; /* SPIC1: SPIE=0,SPE=0,SPTIE=0,MSTR=0,CPOL=0,CPHA=0,SSOE=0,LSBFE=0 */&amp;nbsp; SPIC1 = 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;&amp;nbsp; /* The SPRF interrupt flag is cleared when the SPI module is disabled. */&amp;nbsp; /* SPIC2: MODFEN=0,BIDIROE=0,SPISWAI=0,SPC0=0 */&amp;nbsp; SPIC2 = 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;&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; /* SPIBR: SPPR2=1,SPPR1=1,SPPR0=0,SPR2=1,SPR1=1,SPR0=1 */&amp;nbsp; SPIBR = 0x67;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)(SPIS == 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;&amp;nbsp;&amp;nbsp; /* Dummy read of the SPIS registr to clear the MODF flag */&amp;nbsp; /* SPIC1: SPIE=0,SPE=1,SPTIE=0,MSTR=1,CPOL=1,CPHA=1,SSOE=0,LSBFE=0 */&amp;nbsp; SPIC1 = 0x58;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBDD = 0xee;&amp;nbsp; PTBPE = 0x11;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* ### */&amp;nbsp; asm CLI;&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; /* Enable interrupts */} /*MCU_init*/&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something that just dawned on me as I write this is that I am not packing the read command, MSB and address field of the register I want into the first byte? Yet I don't see this in other forums, which makes causes me to be suspect.&amp;nbsp; Figure 7 (attached) from accelerometer datasheet page 24.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any feedback is much appreciated.&lt;/P&gt;&lt;P&gt;Great forums BTW.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--Victor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 23:58:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198919#M16112</guid>
      <dc:creator>victor_carvajal</dc:creator>
      <dc:date>2010-05-10T23:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198920#M16113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Victor, I recently completed a QG8-based project which used the LIS331DLF (same family I think as yours). Beautiful little part!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I opted to use the I2C interface instead of the SPI, so I can't speak to your SPI code. But in practice, your last realization is &lt;STRONG&gt;very&lt;/STRONG&gt; poignant!&amp;nbsp; You must indeed request data from a particular register before reading any data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 03:04:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198920#M16113</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2010-05-11T03:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198921#M16114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey irob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I modified my original code snippet to follow suit but i still get the response back as 255.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; if (PTAD_PTAD2 == 0)  /* read chip */    {      PTBD_PTBD5 = 0;   /* chip select low */      // address: bit 2-7      // bit 0: read command      // bit 1: multiple read      temp = (((address &amp;amp; 0x3F)&amp;lt;&amp;lt;2)|0x80);                                     memorydata = SPI_proc(temp);            PTBD_PTBD5 = 1;   /* chip select high */     } &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you suggesting that the read command needs to be separate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 04:15:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198921#M16114</guid>
      <dc:creator>victor_carvajal</dc:creator>
      <dc:date>2010-05-11T04:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198922#M16115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Again, I used I2C. I'm not all that familiar with SPI transaction protocol. But in the I2C world, the format is: (for writing) Start Command 7-bit base address + !W bit (LSB) Register address Data Stop bit (for reading) Start Command 7-bit base address + !W bit (LSB) Register address to read from Start Command 7-bit base address + R bit (LSB) Data Stop bit&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 04:49:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198922#M16115</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2010-05-11T04:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198923#M16116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;victor.carvajal wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;EM&gt;SNIP&lt;/EM&gt;&lt;/STRONG&gt;
unsigned char memorydata = 0;
unsigned char temp = 0;
long int address = 0x0F;

&lt;EM&gt;&lt;STRONG&gt;SNIP&lt;/STRONG&gt;
&lt;/EM&gt;
    if (PTAD_PTAD2 == 0)  /* read chip */
    {

      PTBD_PTBD5 = 0;   /* chip select low */

      (void)SPI_proc(3);    /* send read instruction to memory */
      memorydata = SPI_proc(0x0F);    /* red device id */

      PTBD_PTBD5 = 1;   /* chip select high */
   
    } /* loop forever */
  /* please make sure that you never leave main */
  }
}
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What is PTA2 connected to? I see from your comments that PTB5 is connected to chip select.&amp;nbsp; What is the register address 0x0F?&amp;nbsp; When you send the read instruction of 0x03 to the device, what happens to that data?&amp;nbsp; You aren't returning it.&amp;nbsp; So then you call that function again, but this time with the register address, but without a repeated read instruction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to rethink your read function.&amp;nbsp; I would recommend putting the read command inside the read function.&amp;nbsp; That should always happen any time you want to read from a register.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* No such thing as overly-commented code! */&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>Tue, 11 May 2010 05:01:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198923#M16116</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2010-05-11T05:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198924#M16117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Victor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot see any issues with your original code structure except that you were initially attempting to &lt;U&gt;write&lt;/U&gt; to address 0x03, which is a reserved address, according to the datasheet.&amp;nbsp; The datasheet also gives dire warnings about writing to reserved locations, with the risk of permanent damage to the device.&amp;nbsp; Perhaps your code might test whether the address is valid to avoid this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your later post seems to be erroneous with respect to placement of the R/W and MS bits - these are at the bit 7 and bit 6 positions respectively.&amp;nbsp; Additionally, you are only processing a single byte, rather than two bytes minimum.&amp;nbsp; The following function code attempts to correct these issues, but does not show the test for a valid address.&amp;nbsp; A common function is used for both read and write.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;void&amp;nbsp;accel_comms( byte addr, byte ctrl_bits, byte *data)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; // Test for valid address value here&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;PTBD_PTBD5 = 0;&amp;nbsp;&amp;nbsp; /* chip select low */&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(void)SPI_proc((addr &amp;amp; 0x3F) | ((ctrl_bits &amp;amp; 0x03) &amp;lt;&amp;lt; 6));&amp;nbsp;// send instruction&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (ctrl_bits &amp;lt; 2)&amp;nbsp; // Write mode&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)SPI_proc( *data);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; else&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; // Read&amp;nbsp;mode&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *data = SPI_proc(0x0F);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PTBD_PTBD5 = 1;&amp;nbsp;&amp;nbsp; /* chip select high */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 08:04:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198924#M16117</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-05-11T08:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198925#M16118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mac,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the note about my bit misplacement regarding R/W and MS bits.&lt;/P&gt;&lt;P&gt;I've seem in your responses regarding SPI about having to push dummy bytes in order to get the desired result back.&lt;/P&gt;&lt;P&gt;For instance, incorporating your common function, I have to do the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;accel_comms(address, 3, &amp;amp;memorydata); // returns 0accel_comms(address, 3, &amp;amp;memorydata); // returns desired register result&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which gives me a decimal value that maps to a register value in the datasheet.&lt;/P&gt;&lt;P&gt;Is a good initialization technique to&lt;/P&gt;&lt;P&gt;&amp;nbsp; (void)(SPID == 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;&amp;nbsp;&amp;nbsp; /* Dummy read of the device register */&lt;/P&gt;&lt;P&gt;twice in a init() method?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, how would one get automated email to replies? I always seem to be having to check back on the forums to see if any response occured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again everyone, big help.&amp;nbsp; Free beer if you are even in S.Cal, North County San Diego area.&lt;/P&gt;&lt;P&gt;( to iRob and bigMac atleast ) &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 11:49:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198925#M16118</guid>
      <dc:creator>victor_carvajal</dc:creator>
      <dc:date>2010-05-11T11:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198926#M16119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you are logged in, up the top of the page "My Settings" then under the subscriptions tab you can setup your email notifications there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just trying to get a ticket to the free beer.......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 13:46:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198926#M16119</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2010-05-11T13:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198927#M16120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Victor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The accel_comms() function already calls the SPI_proc() function twice, the first time to send the command, and the second to write or read the data byte.&amp;nbsp; For the read process a dummy byte value of 0x0F is sent, but this could be any 8-bit value.&amp;nbsp; So the accel_comms() function need be called only once for a single byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the function using a pointer to a buffer location, this would also enable the function to be easily adapted to handle successive multiple bytes,&amp;nbsp;by having&amp;nbsp;a buffer array.&amp;nbsp; You would need to add a further parameter to specify the number of bytes to be read or written.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make the code operation clearer, you might also define the following macros:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="courier new,courier"&gt;#define&amp;nbsp;ACCEL_WR&amp;nbsp; 1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="courier new,courier"&gt;#define ACCEL_RD&amp;nbsp; 3&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then to read the &lt;FONT face="courier new,courier"&gt;STATUS_REG_AUX&lt;/FONT&gt; register (also defined by a macro) into&amp;nbsp;the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;memorydata&lt;/FONT&gt; variable:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="courier new,courier"&gt;accel_comms( STATUS_REG_AUX, ACCEL_RD, &amp;amp;memorydata);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dummy read of SPID is not necessary during initialisation, however a&amp;nbsp;read of SPIS status register is necessary prior to sending the first byte after the SPI module is enabled.&amp;nbsp; This can be done during SPI initialisation with the code:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="courier new,courier"&gt;(void)SPIS;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The use of the cast avoids a warning message.&amp;nbsp; However, since the SPI_proc() function already tests the state of the SPTEF flag within SPIS, prior to sending each byte, in this case the initial read would be redundant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&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>Tue, 11 May 2010 21:19:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198927#M16120</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-05-11T21:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198928#M16121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;victor.carvajal wrote:&lt;BR /&gt;&lt;P&gt;Thanks again everyone, big help.&amp;nbsp; Free beer if you are even in S.Cal, North County San Diego area.&lt;/P&gt;&lt;P&gt;( to iRob and bigMac atleast ) &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'll hand off my beer to the professionals. Apparently I was way off with my suggestions.&amp;nbsp; I suppose the I2C method is radically different than SPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're in good hands, Victor!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 22:48:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198928#M16121</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2010-05-11T22:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198929#M16122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I m working on LIS3DH, i configured it for wakeup interrupt, and it was generating the interrupt for the interrupt threshold which i gave it in INT1_THS.&lt;/P&gt;&lt;P&gt;I made the Accelerometer to be configured for FullScale of 2G, but when i try to retrieve values from X,Y,Z registers through all Axis, the value goes to a maximum range of 1000mg(~1g),&lt;/P&gt;&lt;P&gt;when it is configured for 4G, the maximum range of 90 degree shift is 500mg(~.5g) and for the&lt;/P&gt;&lt;P&gt;8G, it is `250mg and&lt;/P&gt;&lt;P&gt;16g it shows ~80mg.&lt;/P&gt;&lt;P&gt;So when i try to set an interrupt threshold of above this range of value, i could'n able to trigger the interrupt,since it is not going beyond that particular range in that G level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then how will it be more precise for rise in G level. Kindly any one clear me about this doubt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2012 19:58:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198929#M16122</guid>
      <dc:creator>sureshee</dc:creator>
      <dc:date>2012-07-20T19:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Communication - MC9S08QG8 with accelerometer</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198930#M16123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ROB LUND,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using NXP NHS3100 kit and added my sensor&amp;nbsp;LIS3DH with I2C interface based on the project "app_demo_dp_tlogger" from the &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;NHS3100 SDK&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;I init I2C and use the API functions "Chip_I2C_MasterSend" and "Chip_I2C_MasterRead" but it didn't work properly.&lt;/P&gt;&lt;P&gt;I am looking for some help and found that you have ever use&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;LIS3DH with I2C interface&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthing you can share or help please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 05:42:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SPI-Communication-MC9S08QG8-with-accelerometer/m-p/198930#M16123</guid>
      <dc:creator>aresmarser</dc:creator>
      <dc:date>2018-03-20T05:42:03Z</dc:date>
    </item>
  </channel>
</rss>

