<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Issue with reading WHO AM I Register of ICM20948 over SPI with nRF52832 and Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111604/issue-with-reading-who-am-i-register-of-icm20948-over-spi-with-nrf52832-and-zephyr</link><description>I am trying to read the WHO AM I register of an ICM20948 over SPI with nRF52832, but I am getting incorrect values. 
 I have tried different SPI modes, but none of them work. Later, I tried reading the same register to make sure the module is working</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Sep 2024 07:05:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111604/issue-with-reading-who-am-i-register-of-icm20948-over-spi-with-nrf52832-and-zephyr" /><item><title>RE: Issue with reading WHO AM I Register of ICM20948 over SPI with nRF52832 and Zephyr</title><link>https://devzone.nordicsemi.com/thread/500690?ContentTypeID=1</link><pubDate>Mon, 02 Sep 2024 07:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d01156de-6d1c-4237-a9f2-c23760382525</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m glad to hear that you got the communication up and running!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with reading WHO AM I Register of ICM20948 over SPI with nRF52832 and Zephyr</title><link>https://devzone.nordicsemi.com/thread/500660?ContentTypeID=1</link><pubDate>Sat, 31 Aug 2024 22:21:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afb9bc19-4139-453b-ad61-fa191e2336e1</guid><dc:creator>vimok</dc:creator><description>&lt;p&gt;I made the following change and the code is working now.&lt;/p&gt;
&lt;p&gt;Thank you for the suggestions.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void read_register(uint8_t reg, uint8_t *data, uint32_t size)
{
    int ret;

    struct spi_buf tx_buf = {
        .buf = &amp;amp;reg,
        .len = 1,
    };

    struct spi_buf rx_buf[] = {
        {.buf = NULL, .len = 1},
        {.buf = data, .len = size},
    };

    struct spi_buf_set tx = {.buffers = &amp;amp;tx_buf, .count = 1};
    struct spi_buf_set rx = {.buffers = &amp;amp;rx_buf, .count = ARRAY_SIZE(rx_buf)};

    ret = spi_transceive(spi_dev, &amp;amp;spi_cfg, &amp;amp;tx, &amp;amp;rx);
    if (ret) {
        printk(&amp;quot;SPI read failed with error code %d\n&amp;quot;, ret);
        return;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with reading WHO AM I Register of ICM20948 over SPI with nRF52832 and Zephyr</title><link>https://devzone.nordicsemi.com/thread/486696?ContentTypeID=1</link><pubDate>Thu, 30 May 2024 13:34:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4b19dca-5b23-414a-9975-93eb2be765cb</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t take away the sensor. Scope the pins with the sensor connected, and trace from reboot.&lt;/p&gt;
&lt;p&gt;PS: What is your sampling rate in your logic analyzer? It looks to be 800 Hz, which is way to low of a sampling rate. You should have atleast 8 MHz (preferably 4*Fs, ie. 16 MHz)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with reading WHO AM I Register of ICM20948 over SPI with nRF52832 and Zephyr</title><link>https://devzone.nordicsemi.com/thread/486673?ContentTypeID=1</link><pubDate>Thu, 30 May 2024 12:47:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6c275ee-894b-44ee-a00d-f49fde3d725b</guid><dc:creator>vimok</dc:creator><description>&lt;p&gt;I&amp;nbsp;removed the sensor and connected the pins on logic analyser and am finding issues.&lt;/p&gt;
&lt;p&gt;1. There is no clock signal&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;CS pin is getting&amp;nbsp;high too soon&lt;/p&gt;
&lt;p&gt;Will try to probe more and see what is going on.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1717073198728v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with reading WHO AM I Register of ICM20948 over SPI with nRF52832 and Zephyr</title><link>https://devzone.nordicsemi.com/thread/486442?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 12:36:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ba4d3f6-8e27-402b-8ae1-61deb7fbe771</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you scoped the SPI signals to see how the pins behave, and if they behave as expected?&lt;/p&gt;
&lt;p&gt;If yes, can you share the result here?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>