<?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>nRF52840 Receiving bad Device ID from ADXL362</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57158/nrf52840-receiving-bad-device-id-from-adxl362</link><description>I have an ADXL362 eval board connected to a nRF52840-DK. When I try to read the device ID from the ADXL362 instead of returning 0xAD it most often returns 0x21 and at other times the ADXL362 returns other hex values that are also not correct. 
 I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jan 2020 17:15:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57158/nrf52840-receiving-bad-device-id-from-adxl362" /><item><title>RE: nRF52840 Receiving bad Device ID from ADXL362</title><link>https://devzone.nordicsemi.com/thread/231971?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 17:15:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28f6960e-bed5-4620-93da-1146e9043ec8</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;It ended up that I need to set the H0H1 for the MOSI and SCK pins after the nrf_spi_init() function call. I am getting 0xAD out for the device id now.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));

nrf_gpio_cfg(spi_config.sck_pin, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(spi_config.mosi_pin, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Receiving bad Device ID from ADXL362</title><link>https://devzone.nordicsemi.com/thread/231768?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 23:20:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42f6792a-8812-4b66-a24d-8aa57f31719a</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;In the other case it was recommended setting the clock and miso lines to H0H1. I added these lines to the main file.&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg(spi_config.sck_pin, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);&lt;br /&gt; nrf_gpio_cfg(spi_config.miso_pin, NRF_GPIO_PIN_DIR_INPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
    bsp_board_init(BSP_INIT_LEDS);

    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();

    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    spi_config.frequency = NRF_DRV_SPI_FREQ_125K;
//    spi_config.frequency = NRF_DRV_SPI_FREQ_250K;
//    spi_config.frequency = NRF_DRV_SPI_FREQ_1M;
    spi_config.mode = NRF_DRV_SPI_MODE_0;
    spi_config.bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;
//    spi_config.ss_pin   = SPI_SS_PIN;
//    spi_config.miso_pin = SPI_MISO_PIN;
//    spi_config.mosi_pin = SPI_MOSI_PIN;
//    spi_config.sck_pin  = SPI_SCK_PIN;
    spi_config.ss_pin   = ADXL362_CS_PIN;
    spi_config.orc      = 0xCC;
    spi_config.miso_pin = ADXL362_MISO_PIN;
    
    spi_config.mosi_pin = ADXL362_MOSI_PIN;
    spi_config.sck_pin  = ADXL362_SCK_PIN;

    nrf_gpio_cfg(spi_config.sck_pin, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
    nrf_gpio_cfg(spi_config.miso_pin, NRF_GPIO_PIN_DIR_INPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);

    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));

//    NRF_GPIO_Type * reg2 = nrf_gpio_pin_port_decode(ADXL362_MISO_PIN);
//    reg2-&amp;gt;PIN_CNF[ADXL362_MISO_PIN] |= (NRF_GPIO_PIN_H0H1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos);

    NRF_LOG_INFO(&amp;quot;SPI example started.&amp;quot;);

//    soft_reset(&amp;amp;spi_config);

    while (1)
    {
      device_id(&amp;amp;spi_config);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now I am getting 0xBF out and my MISO line appears to be picking up minor noise from the SCK line.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1580339981358v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Any other thoughts on how to get this working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Receiving bad Device ID from ADXL362</title><link>https://devzone.nordicsemi.com/thread/231761?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 20:39:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44e7e3f6-4be7-4d56-bfa9-56690b426ad2</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;It seems that others have been facing &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/16691/nrf52832--why-when-using-nrf_drv_spi-with-an-adxl362-i-need-to-set-the-clock-in-high-drive-h0h1"&gt;similar issues&lt;/a&gt; before.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Receiving bad Device ID from ADXL362</title><link>https://devzone.nordicsemi.com/thread/231755?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 19:24:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d720d8a3-1658-4e53-bb60-df289befb5fa</guid><dc:creator>Zada</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;It was previously set to 1 and I have changed it to 0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;//&amp;nbsp;&amp;lt;o&amp;gt;&amp;nbsp;NRF_SPI_DRV_MISO_PULLUP_CFG&amp;nbsp;&amp;nbsp;-&amp;nbsp;MISO&amp;nbsp;PIN&amp;nbsp;pull-up&amp;nbsp;configuration.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;//&amp;nbsp;&amp;lt;0=&amp;gt;&amp;nbsp;NRF_GPIO_PIN_NOPULL&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;//&amp;nbsp;&amp;lt;1=&amp;gt;&amp;nbsp;NRF_GPIO_PIN_PULLDOWN&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;//&amp;nbsp;&amp;lt;3=&amp;gt;&amp;nbsp;NRF_GPIO_PIN_PULLUP&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;#ifndef&lt;/span&gt;&lt;span&gt;&amp;nbsp;NRF_SPI_DRV_MISO_PULLUP_CFG&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt;&amp;nbsp;NRF_SPI_DRV_MISO_PULLUP_CFG&amp;nbsp;&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;&amp;nbsp;//&amp;nbsp;previously&amp;nbsp;=&amp;nbsp;1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Now I get 0x90 out from the ADXL362&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/nRF52840-No-Pullup.PNG" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Receiving bad Device ID from ADXL362</title><link>https://devzone.nordicsemi.com/thread/231752?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 19:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f495c55-bccd-4692-952f-2cf0aed4f14f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you check what the config NRF_SPI_DRV_MISO_PULLUP_CFG is set to in your sdk_config.h file? If not set to this already, please try to set it to 0 (NRF_GPIO_PIN_NOPULL).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>