<?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>SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42126/spi-master-pin-set-and-clear</link><description>I am trying to run the SPI code on an NRF52382 based custom board. I am using the NRF 52 DK, Keil uVision 5.0 , SDK 15.2. 
 
 I cannot set and clear the SPI relevant pins on my custom board as gpios. The pins I am using are: 
 SPI_SS_PIN = P0.6 SPI_MISO_PIN</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Jan 2019 23:06:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42126/spi-master-pin-set-and-clear" /><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/166103?ContentTypeID=1</link><pubDate>Wed, 16 Jan 2019 23:06:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0a34f66-fc37-4fe0-a2f9-2a8dd1e2db9d</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;Resolved the issue. Thanks a lot &lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;:)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/166084?ContentTypeID=1</link><pubDate>Wed, 16 Jan 2019 17:29:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbbd9858-66dc-4540-82e8-f9bd711f28e8</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Any of the pins you mention should work, there is no preferred pin. If you have a fatal error it is probably from&amp;nbsp;&lt;em&gt;app_error_fault_handler()&lt;/em&gt; which can be the default handler in &lt;em&gt;app_error_weak.c&lt;/em&gt; or a handler of the same name you have supplied. In either case put a breakpoint on the first code line of that handler and enable &lt;em&gt;Stack Trace&lt;/em&gt;&amp;nbsp;in the IDE debugger so you can see where the error came from. You can do that in any of the usual IDEs (IAR, SES, Keil ..) and see the sucessive code lines which caused the error; Then place a breakpoint on any of the suspect lines and restart-execute again to see what data was causing the error.&lt;/p&gt;
&lt;p&gt;I see you have analogue inputs; if the SAADC is enabled I suggest commenting out that code in case one of those pins is also set as an adc function. With no pins showing up in a search (try search &amp;quot; 6&amp;quot;) it is possible that there is some board hardware issue. A return to the bare-bones example with only the pin 6 changed might be the next step if any of the above doesn&amp;#39;t help ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/165852?ContentTypeID=1</link><pubDate>Wed, 16 Jan 2019 03:45:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3abfa337-b754-40b3-9c2b-693c1257200e</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;Hi again &lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;!&amp;nbsp;&lt;br /&gt;If I am changing my UART _TX pin from P0.6 to another pin in my sdk_config.h file and pca10040.h file &lt;em&gt;&lt;strong&gt;(are these two the only files where I need to make this change in order to disable use of P6 as uart??)&lt;/strong&gt; &lt;/em&gt;what would be a suitable pin number to change it to? I was changing uart_tx from 6 to 5 but that gives me a FATAL ERROR with my putty terminal (so I&amp;#39;m guessing the uart has problems working after).&amp;nbsp;&lt;br /&gt;I need both SPI and UART functionality (i.e. I need to use NRF_LOG_INFO).&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Here is the pin layout of my custom board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1547610281812v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Thanks again.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/165582?ContentTypeID=1</link><pubDate>Mon, 14 Jan 2019 17:14:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06d4125a-372e-4601-a726-5f953d0cef0b</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;NRF_LOG_INFO descends through layers of macros, Nordic might help with that as I don&amp;#39;t use it. This definition is also in that project for pin 6:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin
#ifndef NRF_LOG_BACKEND_UART_TX_PIN
#define NRF_LOG_BACKEND_UART_TX_PIN 6
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/165330?ContentTypeID=1</link><pubDate>Mon, 14 Jan 2019 00:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fd53034-8049-420e-9dbf-1c2dfbe60960</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;I start with the SPI master example. And I changed the TX pin number in the pca10040.h file and the sdk_config.h file. Do I need to change use of pin 6 anywhere else?&amp;nbsp;&lt;br /&gt;Do you have any ideas where the FATAL ERROR is coming from given my code in the above question?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I wonder why printing out tx_buf and rx_buf through NRF_LOG_INFO is giving me addresses.&amp;nbsp;&lt;br /&gt;Thank you.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/165326?ContentTypeID=1</link><pubDate>Sun, 13 Jan 2019 22:12:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e30a834e-52b6-4d54-8bc0-c09d75c01f9a</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Q1: Depends on what example project you started from; if it was the uart BLE example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// pca1004.h
#define RX_PIN_NUMBER  8
#define TX_PIN_NUMBER  6
#define CTS_PIN_NUMBER 7
#define RTS_PIN_NUMBER 5

// and others confusing the issue ..
#define SPIS_MISO_PIN   28  // SPI MISO signal.
#define SPIS_CSN_PIN    12  // SPI CSN signal.
#define SPIS_MOSI_PIN   25  // SPI MOSI signal.
#define SPIS_SCK_PIN    29  // SPI SCK signal.

#define SPIM0_SCK_PIN   29  // SPI clock GPIO pin number.
#define SPIM0_MOSI_PIN  25  // SPI Master Out Slave In GPIO pin number.
#define SPIM0_MISO_PIN  28  // SPI Master In Slave Out GPIO pin number.
#define SPIM0_SS_PIN    12  // SPI Slave Select GPIO pin number.

#define SPIM2_SCK_PIN   12  // SPI clock GPIO pin number.
#define SPIM2_MOSI_PIN  13  // SPI Master Out Slave In GPIO pin number.
#define SPIM2_MISO_PIN  14  // SPI Master In Slave Out GPIO pin number.
#define SPIM2_SS_PIN    15  // SPI Slave Select GPIO pin number.

// serialization APPLICATION board - temp. setup for running serialized MEMU tests
#define SER_APP_RX_PIN              23    // UART RX pin number.
#define SER_APP_TX_PIN              24    // UART TX pin number.
#define SER_APP_CTS_PIN             2     // UART Clear To Send pin number.
#define SER_APP_RTS_PIN             25    // UART Request To Send pin number.

#define SER_APP_SPIM0_SCK_PIN       27     // SPI clock GPIO pin number.
#define SER_APP_SPIM0_MOSI_PIN      2      // SPI Master Out Slave In GPIO pin number
#define SER_APP_SPIM0_MISO_PIN      26     // SPI Master In Slave Out GPIO pin number
#define SER_APP_SPIM0_SS_PIN        23     // SPI Slave Select GPIO pin number
#define SER_APP_SPIM0_RDY_PIN       25     // SPI READY GPIO pin number
#define SER_APP_SPIM0_REQ_PIN       24     // SPI REQUEST GPIO pin number

// serialization CONNECTIVITY board
#define SER_CON_RX_PIN              24    // UART RX pin number.
#define SER_CON_TX_PIN              23    // UART TX pin number.
#define SER_CON_CTS_PIN             25    // UART Clear To Send pin number. Not used if HWFC is set to false.
#define SER_CON_RTS_PIN             2     // UART Request To Send pin number. Not used if HWFC is set to false.

// main.c
/**@brief  Function for initializing the UART module.
 */
/**@snippet [UART Initialization] */
static void uart_init(void)
{
    uint32_t                     err_code;
    app_uart_comm_params_t const comm_params =
    {
        .rx_pin_no    = RX_PIN_NUMBER,
        .tx_pin_no    = TX_PIN_NUMBER,
        .rts_pin_no   = RTS_PIN_NUMBER,
        .cts_pin_no   = CTS_PIN_NUMBER,
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Q2: Is the value you report from the NRF_LOG_INFO or from looking in the debugger?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; .. rxbuf = %d, txBuf = %d&amp;quot;, m_rx_buf[0], m_tx_buf[0],&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;%d&lt;/em&gt; is a 32-bit signed decimal integer, but you really want to display an 8-bit unsigned hex integer so I would suggest replacing &lt;em&gt;%d&lt;/em&gt; with &lt;em&gt;%02X&lt;/em&gt;. Hex value 0x80 will display as &lt;em&gt;&amp;quot;80&amp;quot;.&lt;/em&gt; However that is not the issue in the number &lt;em&gt;0x20000002&lt;/em&gt;&amp;nbsp;(which you would preferably write as &lt;em&gt;2000:0002&lt;/em&gt; hex); notice &lt;em&gt;2000:0002&lt;/em&gt; is exactly 4 bytes less than &lt;em&gt;2000:0006&lt;/em&gt;, which is the clue you are looking for. I suggest that &lt;em&gt;2000:0002&lt;/em&gt; is the starting memory address of your array &lt;em&gt;m_tx_buf[4]&lt;/em&gt; and &lt;em&gt;2000:0006&lt;/em&gt; the address of &lt;em&gt;m_rx_buf[4]&lt;/em&gt;. Open a memory window and look at the &lt;em&gt;content&lt;/em&gt; of those memory locations to see your actual tx and rx data values, or quicker look at the log output string if available.&lt;/p&gt;
&lt;p&gt;Q3: Equivalent to Mode 1 (it was actually a different mcu); SPI clock low with rising edge shifting data out, clock period 0.5 uSecs, data order MSB first&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/165324?ContentTypeID=1</link><pubDate>Sun, 13 Jan 2019 21:06:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05242455-fe4a-4ddb-970a-2308538d8559</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;I do not think the FATAL ERROR is because of sending NULL in the spi_transfer() function. I am using the code below (sending a full tx_buf without any NULL but I still get a fatal error).&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I changed the UART _TX pin from 6 to 26 in the sdk_config.h file and changed the TX_PIN_NUMBER and RX_PIN_NUMBER in the pca10040.h file. But that does not fix the problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1547413356095v1.png" /&gt;&lt;br /&gt;&lt;br /&gt;I did manage to pull down PIN 6 (my CS pin) as a GPIO by configuring it in high drive. Pin 6 goes down to 150mV which is a logical 0. &lt;strong&gt;But I am still worried because the program still gives me a fatal error and the RX_BUF seems to read a fixed address instead of taking in data from any input.&amp;nbsp; &amp;nbsp;My rx_buf always contains an int value of &amp;quot;20000006 &amp;quot; no matter what the input. And the tx_buf prints out on the NRF_LOG and int value of &amp;quot;20000002&amp;quot;&amp;nbsp; even though I am sending &amp;quot;08000000&amp;quot;.&amp;nbsp; I do not understand where the fatal error comes from and why my rx_buf and tx_buf always read these values even when there is no reference to these in the codes? I am using they echo some address... ?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am inserting my code here again for reference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Copyright (c) 2015 - 2018, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
#include &amp;quot;nrf_drv_spi.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

#define SPI_INSTANCE  0 /**&amp;lt; SPI instance index. */
#define S0 21
#define S1 22
#define S2 23
#define S3 24
#define CS 6

static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);  /**&amp;lt; SPI instance. */
static volatile bool spi_xfer_done;  /**&amp;lt; Flag used to indicate that SPI instance completed the transfer. */


static uint8_t       m_tx_buf[4];           /**&amp;lt; TX buffer. */
static uint8_t       m_rx_buf[4];    /**&amp;lt; RX buffer. */
static const uint8_t tx_length = sizeof(m_tx_buf);        /**&amp;lt; Transfer length. */
static const uint8_t rx_length = sizeof(m_rx_buf); 

/**
 * @brief SPI user event handler.
 * @param event
 */
void spi_event_handler(nrf_drv_spi_evt_t const * p_event,
                       void *                    p_context)
{
    spi_xfer_done = true;
     NRF_LOG_INFO(&amp;quot;Transfer completed.&amp;quot;);
			NRF_LOG_HEXDUMP_INFO(m_rx_buf, strlen((const char *)m_rx_buf));
			  
			  
}


void init_pins () {
	
	nrf_gpio_cfg_output(S0); 
	nrf_gpio_cfg_output(S1); 
	nrf_gpio_cfg_output(S2); 
	nrf_gpio_cfg_output(S3);
	nrf_gpio_cfg_output(CS); 
	 
	nrf_gpio_pin_set (S3); 
	nrf_gpio_pin_clear (S1);
	nrf_gpio_pin_clear (S2);
	nrf_gpio_pin_set (S0);
		

	
	
}

int main(void)
{
   // bsp_board_init(BSP_INIT_LEDS);
		
	
	
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
   // NRF_LOG_DEFAULT_BACKENDS_INIT();
		
	
NRF_LOG_FLUSH();
	NRF_LOG_INFO (&amp;quot;Example started: &amp;quot;);
	nrf_delay_ms(5); 
    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    spi_config.miso_pin = SPI_MISO_PIN;
    spi_config.mosi_pin = SPI_MOSI_PIN;
    spi_config.sck_pin  = SPI_SCK_PIN;
		spi_config.frequency = NRF_DRV_SPI_FREQ_1M; 
		spi_config.mode     = NRF_DRV_SPI_MODE_1; 
		//spi_config.irq_priority = APP_IRQ_PRIORITY_HIGHEST;
	
		
		nrf_gpio_cfg_output(SPI_SCK_PIN); 
		nrf_gpio_cfg_output(SPI_MOSI_PIN);
		nrf_gpio_cfg_input (SPI_MISO_PIN, NRF_GPIO_PIN_NOPULL); 
	
		
	
	
    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));
    nrf_delay_ms(20); 
		
		
		
		
		init_pins();    // configure CS as output and set it to HIGH 

nrf_gpio_cfg(CS,
                 NRF_GPIO_PIN_DIR_OUTPUT,
                 NRF_GPIO_PIN_INPUT_CONNECT,
                 NRF_GPIO_PIN_NOPULL,
                 NRF_GPIO_PIN_H0H1,
                 NRF_GPIO_PIN_NOSENSE);

nrf_delay_ms(10); 

								 
		memset(m_tx_buf, 0, tx_length);
		memset(m_tx_buf, 0, rx_length);
		m_tx_buf[0] = 0x08;  //START/SYNC HEX COMMAND FOR ADS1220  
		
		
	 
		nrf_gpio_pin_clear(CS); 

		APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf, tx_length, m_rx_buf, rx_length));

        while (!spi_xfer_done)
        {
            __WFE();
        }
			
				nrf_delay_ms(10); 
				
				
	
		memset(m_tx_buf, 0, tx_length);
		m_tx_buf[0] = 0x08;  //START/SYNC 
			
nrf_delay_ms(10); 				
    for (;;)
    {
			
				
        // Reset rx buffer and transfer done flag
        memset(m_rx_buf, 0, rx_length);
				m_tx_buf[0] = 0x08; 
        spi_xfer_done = false;
				
				nrf_delay_ms(15); 
				NRF_LOG_INFO (&amp;quot; Before Transfer , after memset _ rxbuf = %d, txBuf = %d&amp;quot;, m_rx_buf[0], m_tx_buf[0]);
				
        APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf, tx_length, m_rx_buf, rx_length));

        while (!spi_xfer_done)
        {
            __WFE();
        }

        NRF_LOG_FLUSH();

        //bsp_board_led_invert(BSP_BOARD_LED_0);
        nrf_delay_ms(800);
				
				
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Q1: Am I missing some other file where I should disable the other uses of pin P0.6?&amp;nbsp;&lt;br /&gt;Q2: I think that forcing the pin 6 down (though successful when I config p6 as high drive) is causing the fatal error. The SPI transfer is not complete or sucessful because my tx and rx buffers read a fixed register value/address ...?&lt;br /&gt;Q3: Did you use Mode 1 or Mode 0 in your SPI code for ADS1220?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164376?ContentTypeID=1</link><pubDate>Mon, 07 Jan 2019 20:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d2e5792-aa2f-4aea-a10b-00b6738569b5</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;See .\nRF5_SDK_15.2.0_9412b96\components\boards/pca10040.h for the serial port pin definitions using pin 6.&lt;/p&gt;
&lt;p&gt;Fatal Error .. is that coming from an assert()?&lt;/p&gt;
&lt;p&gt;I would suggest moving the following code until after the loop in main; ie logging only when spi_xfer_done is set otherwise the huge delay in that interrupt handler can cause all sorts of issues which will cloud what is going on:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;     NRF_LOG_INFO(&amp;quot;Transfer completed.&amp;quot;);
    //if (m_rx_buf[0] != 1)
    //{
        NRF_LOG_INFO(&amp;quot; Received:&amp;quot;);
        NRF_LOG_HEXDUMP_INFO(m_rx_buf, strlen((const char *)m_rx_buf));
			  nrf_delay_ms(10); 
			  NRF_LOG_INFO (&amp;quot;Received:  %d  Transmitted:  %d  \n&amp;quot;, m_rx_buf, m_tx_buf); 
    //}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164374?ContentTypeID=1</link><pubDate>Mon, 07 Jan 2019 19:35:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdf90c88-335f-4995-b44f-510bbaecf969</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;Yes, some of my serial uart is enabled. I need to read data from my ADC and send it to the computer via the uart (i.e. I am using NRF_LOG_INFO ). I did change the UART_TX pin number from 6 to 5 in the sdk_config.h file before I even started. That should be okay since pin 5 is unused on my custom board. I am sure pin 6 is not being used anywhere else in the sdk_config.h of my project. Where else should I be checking to make sure where else it is being used? To stop its UART_TX functionality, is removing it from the sdk file enough?&amp;nbsp;&lt;br /&gt;&lt;em&gt;P.S. I tried removing all NRF_LOG and LOG initialization code (all the data logging code) in my main file and running the code but the problem persists.&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;My ADS1220 pins are:&amp;nbsp;&lt;/strong&gt;&lt;br /&gt;pin 11 - 3.3V, pin 10 at 5V,&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;Pin 6 and 7 are both at 1.8V.&amp;nbsp; All the rest of the pins on ADS1220 are as you said should be.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Here is my code&lt;/strong&gt;. What I get from this code is &lt;em&gt;FATAL ERROR on my putty terminal&lt;/em&gt;, and I believe the values of the &lt;em&gt;RX and TX registers are showing the addresses of some registers, not data&lt;/em&gt;&amp;nbsp;because although these values are persistent (do not change/aren&amp;#39;t garbage), they are not corresponding to my voltage data input.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Copyright (c) 2015 - 2018, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
#include &amp;quot;nrf_drv_spi.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

#define SPI_INSTANCE  0 /**&amp;lt; SPI instance index. */
#define S0 21
#define S1 22
#define S2 23
#define S3 24
#define CS 6

static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);  /**&amp;lt; SPI instance. */
static volatile bool spi_xfer_done;  /**&amp;lt; Flag used to indicate that SPI instance completed the transfer. */


static uint8_t       m_tx_buf[4];           /**&amp;lt; TX buffer. */
static uint8_t       m_rx_buf[4];    /**&amp;lt; RX buffer. */
static const uint8_t tx_length = sizeof(m_tx_buf);        /**&amp;lt; Transfer length. */
static const uint8_t rx_length = sizeof(m_rx_buf); 

/**
 * @brief SPI user event handler.
 * @param event
 */
void spi_event_handler(nrf_drv_spi_evt_t const * p_event,
                       void *                    p_context)
{
    spi_xfer_done = true;
     NRF_LOG_INFO(&amp;quot;Transfer completed.&amp;quot;);
    //if (m_rx_buf[0] != 1)
    //{
        NRF_LOG_INFO(&amp;quot; Received:&amp;quot;);
        NRF_LOG_HEXDUMP_INFO(m_rx_buf, strlen((const char *)m_rx_buf));
			  nrf_delay_ms(10); 
			  NRF_LOG_INFO (&amp;quot;Received:  %d  Transmitted:  %d  \n&amp;quot;, m_rx_buf, m_tx_buf); 
    //}
}


void init_pins () {
	
	nrf_gpio_cfg_output(S0); 
	nrf_gpio_cfg_output(S1); 
	nrf_gpio_cfg_output(S2); 
	nrf_gpio_cfg_output(S3); 
	 
	nrf_gpio_pin_set (S3); 
	nrf_gpio_pin_clear (S1);
	nrf_gpio_pin_clear (S2);
	nrf_gpio_pin_set (S0);
		

	
	
}

int main(void)
{
   // bsp_board_init(BSP_INIT_LEDS);
		
	
	
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
   // NRF_LOG_DEFAULT_BACKENDS_INIT();
		
	
		nrf_delay_ms(50); 
	
NRF_LOG_FLUSH();
	NRF_LOG_INFO (&amp;quot;Hi...&amp;quot;);
	nrf_delay_ms(5); 
    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    spi_config.miso_pin = SPI_MISO_PIN;
    spi_config.mosi_pin = SPI_MOSI_PIN;
    spi_config.sck_pin  = SPI_SCK_PIN;
		spi_config.frequency = NRF_DRV_SPI_FREQ_4M; 
		spi_config.mode     = NRF_DRV_SPI_MODE_1; 
		//spi_config.irq_priority = APP_IRQ_PRIORITY_HIGHEST;
	
		
		nrf_gpio_cfg_output(SPI_SCK_PIN); 
		nrf_gpio_cfg_output(SPI_MOSI_PIN);
		nrf_gpio_cfg_input (SPI_MISO_PIN, NRF_GPIO_PIN_NOPULL); 
	
		
	
	
    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));
    nrf_delay_ms(20); 
		
		
		
		nrf_delay_ms(20);
		init_pins();    // configure CS as output and set it to HIGH 

nrf_gpio_cfg(CS,
                 NRF_GPIO_PIN_DIR_OUTPUT,
                 NRF_GPIO_PIN_INPUT_CONNECT,
                 NRF_GPIO_PIN_NOPULL,
                 NRF_GPIO_PIN_H0H1,
                 NRF_GPIO_PIN_NOSENSE);

//nrf_gpio_cfg_output(CS);
//nrf_gpio_pin_clear(CS); 
								 
		memset(m_tx_buf, 0, tx_length);
		memset(m_tx_buf, 0, rx_length);
		m_tx_buf[0] = 0x08;  //START/SYNC HEX COMMAND FOR ADS1220  
		
		NRF_LOG_INFO(&amp;quot;SPI example started. TX : %d   RX:  %d  \n&amp;quot;, m_tx_buf, m_rx_buf);
	 
		nrf_gpio_pin_clear(CS); 
		nrf_delay_ms(1); 
		APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf, tx_length, m_rx_buf, rx_length));

        while (!spi_xfer_done)
        {
            __WFE();
        }
			
				nrf_delay_ms(10); 
				
				
	
		memset(m_tx_buf, 0, tx_length);
		m_tx_buf[0] = 0x08;  //START/SYNC 
				
    for (;;)
    {
			
				
        // Reset rx buffer and transfer done flag
        memset(m_rx_buf, 0, rx_length);
        spi_xfer_done = false;
				
				nrf_delay_ms(15); 
				NRF_LOG_INFO (&amp;quot; Before Transfer , after memset _ rxbuf = %d, txBuf = %d&amp;quot;, m_rx_buf[0], m_tx_buf[0]);
				
        APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf, tx_length, m_rx_buf, rx_length));

        while (!spi_xfer_done)
        {
            __WFE();
        }

        NRF_LOG_FLUSH();

        //bsp_board_led_invert(BSP_BOARD_LED_0);
        nrf_delay_ms(800);
				
				
    }
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164103?ContentTypeID=1</link><pubDate>Sat, 05 Jan 2019 19:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed043a55-9972-460e-b584-09d8d993f4d2</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;On the ADS1220 the dedicated /DRDY signal is not open-drain and will drive to a high level (3.3 volts) except when pulsing low to indicate data ready; therefore P0.10 will have 3.3 volts as you observe (ie correct behavior).&lt;/p&gt;
&lt;p&gt;The pin 6 issues you see imply either a short to another pin on the ADS1220 or pin 6 being used somewhere else in the code on another nRF52 peripheral. It is also possible (unlikely) that the ADS1220 GND is sitting at +1.0 volts and the schottky clamp diodes in the ADS1220 therefore hold pin 6 at 0.7 volts. Are you switching the voltage supplies to the ADS1220 with port pins, or have any series resistance in the GND line? Note 2.7 volts + 0.7 volts is also suspiciously close to 3.3 volts, though that may be a red herring. Connecting pin 5 to pin 6 would be a hack and may hide the true issue you are looking for.&lt;/p&gt;
&lt;p&gt;The ADS1220 has no requirement for any pull-up or pull-down resistors on any of the SPI lines, including /CS and /DRDY, and I have never had any issues in driving these lines. I suggest you post the actual code text of the spi code init and handler you are using with an &lt;em&gt;Insert Code&lt;/em&gt; box. I will look out settings I have used on this chip and post them later this weekend. Pins 7, 10, and 11 should be at 3.3 volts. Pins 1,2,3,4,6 and 17 should all be at Gnd (0v wrt nRF52) unless you are doing something special.&lt;/p&gt;
&lt;p&gt;One last comment, have you left any serial uart code enabled? The default for the PCA10040 which I think you started with has the following conflict with pin P0.6:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define RX_PIN_NUMBER  8
#define TX_PIN_NUMBER  6
#define CTS_PIN_NUMBER 7
#define RTS_PIN_NUMBER 5
#define HWFC           true
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164094?ContentTypeID=1</link><pubDate>Sat, 05 Jan 2019 16:02:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f656c186-1f50-463c-93f5-833e306fad52</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;&amp;nbsp;So I fixed this ^ that you pointed out. I now initialize m_tx_buf [0] = 0x08 and rest of m_tx_buf array to 0 ; and then do&amp;nbsp;&lt;em&gt;nrf_drv_spi_transfer(&amp;amp;spi, m_tx_buf, tx_length, m_rx_buf, rx_length). &lt;/em&gt;But the problem is same as before. I also noticed that there are NO LEDs on my custom PCB device that I am programming so I commented out all the BSP and LED relevant code and run the program again. But that did not fix the issue either. If I use P0.6 as a simple GPIO in the same project with the SPI parts commented out, it works fine and sets to clear if I want to.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I even redefiened &amp;quot; #define NRF_DRV_SPI_PIN_NOT_USED&amp;nbsp; 0x00&amp;nbsp; &amp;nbsp;from 0xFF&amp;quot; in the nrf_drv_spi header file to make the default spi_not_used value 0 but that did not work either.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Another thing that I noticed: Even though I am not initializing, or using the DRDY pin ((P0.10) on my nrf) anywhere in the entire project, just it being connected to the DRDY on the ADS1220 (the ADC) chip on my PCB makes it go to 3.3V (Vdd) instead of a float value (as it should be if it is unused and unconfigured).&amp;nbsp; Also, when I set the CS pin to HIGH it goes up to 2.6 V (not upto 3.3V like the other pins do when they are HIGH). Do these things say sth about how the ADC is working?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thank you once again.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Since I am working with a custom PCB changing the CS pin would mean making another layout and board. Would you recommend I short pin 6 to pin 5 externally on the nrf52 on the PCB and then use pin 5 to control CS? When you were using ADS1220 , did you get problems with its CS pin at all, and were you externally tying it down to DGND? I remember running SPI on another ADS1220 chip using nrf52 DK first and was getting problems running SPI master successfully earlier as well. This is why I shifted to the custom PCB.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164081?ContentTypeID=1</link><pubDate>Sat, 05 Jan 2019 02:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14144b4f-b2e0-425a-8be7-0572ca7e01cc</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;This is the &lt;em&gt;assert&lt;/em&gt; trap:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    ASSERT(p_cb-&amp;gt;state != NRF_DRV_STATE_UNINITIALIZED);
    ASSERT(p_xfer_desc-&amp;gt;p_tx_buffer != NULL || p_xfer_desc-&amp;gt;tx_length == 0);
    ASSERT(p_xfer_desc-&amp;gt;p_rx_buffer != NULL || p_xfer_desc-&amp;gt;rx_length == 0);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164080?ContentTypeID=1</link><pubDate>Sat, 05 Jan 2019 02:03:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e36ac092-e303-48c0-87fb-ca71c70d1390</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Ah, I think your code will not work as NULL for tx buffer and length is not valid and will cause an assert. I imagine that setting a command byte but not transmitting it was not what you intended; here is a typical invocation:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;mAfePacketTransferComplete = false;
APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;mAfeSpiInstance, mTxBuf, mRxTxBufLength, mRxBuf, mRxTxBufLength));
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Compare this with the &lt;em&gt;nrf_drv_spi_transfer()&lt;/em&gt; you are using in your code image, and you will note that the transmit command and length are both NULL, or zero, which is not acceptable.&lt;/p&gt;
&lt;p&gt;Also, just as an aside, what pins are the LEDs on?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164075?ContentTypeID=1</link><pubDate>Sat, 05 Jan 2019 01:13:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6861847f-70be-4d4b-ba1c-f00cc62230ac</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;Here is my SPI code :&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1546650692261v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1546650753226v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1546650815461v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I hope the images are visible in a comment...&lt;br /&gt;Thank you for your help! I appreciate it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164071?ContentTypeID=1</link><pubDate>Sat, 05 Jan 2019 00:21:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a09d6a0c-4f95-4d91-8223-60bf68894103</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I have used the ADS1220, albeit on a Dialog BLE radio, and not had any issues; the /CS worst-case leakage on that device is only 10uA and so there must be some other hardware or software item interfering with operation of the pin. Since that only happens with your spi code enabled, either there is something still in contention in the code or maybe there is a fault on the ADS1220; can you try a second board, just in case? Maybe also post the spi init code ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164070?ContentTypeID=1</link><pubDate>Sat, 05 Jan 2019 00:04:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca056d01-cdd1-4e15-9ffe-ca63cc8d46b1</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;Yes I did do that. I set it to NOT_USED in the nrf_drv_spi.h file before I configured it as high low drive.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;There is another thing I tried after that. I tried enabling my peripheral with pin 6 as a gpio instead of as the SPI slave select pin. I set &lt;em&gt;spi.config.ss_pin&lt;/em&gt; to&amp;nbsp;NRF_DRV_SPI_PIN_NOT_USED. And then I did not set Pin 6 to spi.config.ss_pin. Instead I set Pin 6 to LOW as a simple GPIO and said that SPI_SS_PIN is not used (there is no hardware pin connected to SS).&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But surprisingly I got the same result.&amp;nbsp;&lt;br /&gt;The peripheral I am using is the ADS1220 (analog to digital conv). Maybe it sets its slave select to 0.7 V whenever it is provided clock and there is sth withe the ADC?&amp;nbsp;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164069?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 23:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e44f8bb-54b3-4113-9847-2d27df732aee</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;When SPI is enabled did you set the pin to&amp;nbsp;NRF_DRV_SPI_PIN_NOT_USED as I mentioned above when manually driving the pin? ie &lt;em&gt;spi_config.ss_pin =&amp;nbsp;NRF_DRV_SPI_PIN_NOT_USED&lt;/em&gt;. Otherwise the spi still drives the pin ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164065?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 22:52:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9cf4a05-d437-4619-b947-0f4f1646a491</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;&lt;strong&gt;If I am not using SPI (in the exact same project , I just comment out all the SPI relevant code), I can clear P0.6 (my SPI_SS_PIN) perfectly (it goes down to mVs)....&amp;nbsp;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;I am not sure what this means? Is it something the SPI code does to the SS pin?&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164064?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 22:51:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f81429dc-e354-4d53-aa95-49e74f9168c3</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;&amp;quot;&lt;em&gt;configure SPI_SS_PIN as output&lt;/em&gt;&amp;quot; will revert the pin to default drive strength, which is to low drive; the code I posted replaces that configure, or should be placed after that configure to take effect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164063?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 22:39:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7155178c-1c06-4b32-84a4-56ad0881ac9f</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;I just tried adding the above nrf_gpio_cfg(..) code in my main loop. I add it after &amp;quot;spi_config.ss_pin&amp;nbsp; &amp;nbsp;= SPI_SS_PIN;&amp;quot; and before I configure SPI_SS_PIN as output.&amp;nbsp;&lt;br /&gt;But the pin is still at 0.7 V (not exactly LOW )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164062?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 22:39:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d2a85ed-754c-4637-b588-6014391998f6</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;As for the falling edge vs. 0, no the /CS pin is only required to be low while the clock and data are active, when high clock and data are ignored. If possible I would disconnect the /CS pin at the spi slave device and see what voltage it goes to; with the /CS disconnected you can short MOSI and MISO together and do a loop-back test to verify data transmitted is actually received back at the spi handler. You mention /DRDY; is this an AFE?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164061?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 22:31:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14230a10-11fc-4f00-833b-947a550a5652</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Just possible your spi device requires a harder active-low drive, though I doubt it. You can test this by increasing the low drive power, if you haven&amp;#39;t already.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_gpio_cfg(SPI_SS_PIN,
                 NRF_GPIO_PIN_DIR_OUTPUT,
                 NRF_GPIO_PIN_INPUT_CONNECT,
                 NRF_GPIO_PIN_NOPULL,
                 NRF_GPIO_PIN_H0S1,
                 NRF_GPIO_PIN_NOSENSE);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I assume nothing else connects to the /CS pin ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/164053?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 21:47:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6713fac-372d-491b-99a1-5f37141f6dbc</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;Updated:&amp;nbsp; &amp;nbsp;Now I am configuring the CS pin after I initialize the SPI and it seems to work because the pin goes down to 0.7 V from the earlier Vdd HIGH 3.3V. However, even though the voltage value reduced I do not think this means the SPI_SS_PIN is LOW because the LOW value on my board is typically in millivolts.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am thinking the 0.7V for the CS pin is a floating value. And I do not get why I cannot clear the SPI_SS_PIN?&amp;nbsp;&amp;nbsp;&lt;br /&gt;Could this be because the SPI_SS_PIN needs to have a falling edge (and not clear 0) for the SPI peripheral device to be connected?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/163854?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 21:48:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52f7d69b-320e-496a-b67f-67e68357e0a9</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Depends perhaps on when you are doing a set/clear test; try setting the SPI_SS_PIN pin to&amp;nbsp;NRF_DRV_SPI_PIN_NOT_USED before initialising the spi, and see if that allows manually set/clear of the /CS pin. Note in this case a manual configuration of the pin to Output must be made as the SPI driver is no longer controlling the pin. The reason for doing this is to ensure nothing else is interfering with the pin; the spi driver does not control the /CS pin with hardware spi but instead runs a set or clear instruction encapsulating the hardware spi transmission. That means the user can just as easily do the set/clear before and after the spi transfer, or allow the handler to do it as in your case.&lt;/p&gt;
&lt;p&gt;Other devices have hardware control over the /CS pin (similar to SCK, MOSI and MISO), but not the nRF52832.&lt;/p&gt;
&lt;p&gt;Also you are probably aware, but if you are testing on a DK then pin 6 is connected in hardware ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master pin set and clear</title><link>https://devzone.nordicsemi.com/thread/163853?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 21:32:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b1cd2c0-2bd2-418f-a7ed-1ad6162960e1</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;Update : I am using SPI instance 0. I am trying to run a single transfer without using DRDY... Following settings:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;spi_config.frequency = NRF_DRV_SPI_FREQ_4M; &lt;br /&gt; spi_config.mode = NRF_DRV_SPI_MODE_1; &lt;br /&gt; spi_config.irq_priority = APP_IRQ_PRIORITY_HIGHEST;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>