<?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 Prbolem , Clock dosen&amp;#39;t work</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19766/spi-prbolem-clock-dosen-t-work</link><description>Why the SPI clk doesn&amp;#39;t work, i checked using an oscilloscope :/
I also don&amp;#39;t get any SPI interrupt and no data change in the RX buffer although I have wired MISO and MOSI 
 void vSensor_eInitSensor_Exe()
{
 /*Config SPI PINs*/
 nrf_gpio_pin_set</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Feb 2017 14:30:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19766/spi-prbolem-clock-dosen-t-work" /><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76855?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 14:30:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1313e62-ef20-4932-a86a-9fe88c392a38</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;Ok thanks for your help.  I didn&amp;#39;t succeed to use my function and my own driver.  So I will , as I have to finish this project, to use Nordic driver .
Thanks for your help again although i didn&amp;#39;t exactly why my driver didn&amp;#39;t run.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76857?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 12:02:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14995442-c0df-43d3-9783-4c69580a565e</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The interrupt handler from the SPI driver: I did not define my own interrupt handler (this would also crete multiple definitions unless I removed the the SPI driver files (nrf_drv_spi.c) or removed the interrupt handler in the spi driver).&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t have to use the SPIM structure. You can choose between the SPIM and SPI peripheral on nRF52.&lt;/p&gt;
&lt;p&gt;Why do you not want to use the nordic driver? The error with &lt;code&gt;bsp_btn_ble_on_ble_evt(..)&lt;/code&gt; was probably just pin conflicts between the SPI you set up and the buttons or LEDs  the BSP module uses.&lt;/p&gt;
&lt;p&gt;Also: When I tested I ran these to lines in the while loop in main with some delay after (e.g. nrf_delay_ms(1000)):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_spim_event_clear(&amp;amp;stSPI_iNRF_SPI_Type,NRF_SPIM_EVENT_ENDRX);
nrf_spim_task_trigger(&amp;amp;stSPI_iNRF_SPI_Type,NRF_SPIM_TASK_START);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76860?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 16:39:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57d98d5f-ac7a-4885-a009-7635ebcb207c</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;What do you mean by : with the interrupt handler from SPI driver?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76859?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 16:18:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:779db43c-f22d-4505-bfe8-6bf186d3f4b9</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;Do I have to use SPIM structure? I think I need only SPI , because SPIM uses DMA. Can that be a rpoblem ?
Hey I told you in the last comments that it works with the driver layer implemented by NORDIC but not mine. I copied all same way..initialization ..I am really confused.&lt;/p&gt;
&lt;p&gt;I used also SPI structure,,,not SPIM but nothing new!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76858?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 12:48:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3e121e2-cf13-4b9d-b7d1-e22aa29d15b8</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;I tested your code and got it to work when I commented out &lt;code&gt;//nrf_spim_int_enable(&amp;amp;stSPI_iNRF_SPI_Type, ...);&lt;/code&gt;. I used the SPI example in the SDK as a base (with the interrupt handler from the SPI driver). You should try to only run the SPI code to see if it works without the BLE stuff.&lt;/p&gt;
&lt;p&gt;Also, in the interrupt handler you have to clear the event that triggered the interrupt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (nrf_spim_event_check(p_spim, NRF_SPIM_EVENT_END))
{
    nrf_spim_event_clear(p_spim, NRF_SPIM_EVENT_END);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or else you will not get any more interrupts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76856?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2017 16:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba3752ef-caed-4817-887e-3409556664d7</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;I commented the line :  &lt;code&gt;//nrf_spim_int_enable(&amp;amp;stSPI_iNRF_SPI_Type, ...);&lt;/code&gt;
it dosen&amp;#39;t work :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76854?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2017 16:16:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:195ae994-7c78-47a1-bd61-e8411a9d9a8d</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;yeah I defined my intrrupt handler, and it dosen(t work, as there is no CLK working already, so no interrupt.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define SPIM_IRQ                    SPI0_TWI0_IRQn
#define SPI0_TWI0_IRQHandler        vSensor_iSPI0_TWI0_IRQHandler_Exe
#define SPIM_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW

    void vSensor_iSPI0_TWI0_IRQHandler_Exe(void) 
{
	 ui8RXCounter++;
	 /*Cehck End sending Flag*/
	 if(true==nrf_spim_event_check(&amp;amp;stSPI_iNRF_SPI_Type,NRF_SPIM_EVENT_ENDRX))
	 {
		 ui8RXCounter++;
	 }
	 
	 else
	 {
		 /*empty else*/
	 }
	 
	 if(3==ui8RXCounter)
	 {
		 /*3 bytes are read*/
		 //ui8RXCounter=0;
		 /*Extarct data &amp;amp; check status bytes*/
		 if(0x01==((ui8RxBuffer[SPI_RX_BYTES_NB-1]&amp;amp;AD7780_STAT_PAT0)|(ui8RxBuffer[SPI_RX_BYTES_NB-1]&amp;amp;AD7780_STAT_PAT1)))
		 {
			  /*Serial transfer was correctly performed ==&amp;gt; push in the FIFO*/
		 
					uint8_t tmpPtr = 0;
				  tmpPtr = ucPushPtr + 1;
					if(tmpPtr &amp;gt;= DfMaxBufferSize) tmpPtr = 0;
					if(tmpPtr != ucPopPtr)
						{
							fMeasureVlaues[ucPushPtr] = (uint32_t )(fSensor_iConvertToVolatage_Exe(ulSensor_iAdcMeasure_Get(ui8RxBuffer))) ;
							ucPushPtr = tmpPtr;
						}
		 }
		 else
		 {
			 /*empty else*/
		 }
	 }
	 else
	 {
		  /*empty else*/
	 }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;the content  of the handler not really done well,, i am still fixing it, but it never enter to it already,,i am doing that counter ui8RXCounter and it is also 0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76853?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2017 16:12:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd869477-d159-4eb1-a3de-65b850349221</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;Look waht I did :
I am using the ble_app_hrs and I want to integrate SPI part. I took it from the project SPI in the examples.
I just did my driver layer,, what I attached in the question it dosen&amp;#39;t work. Now I used the driver elaborated by Nordic but dosen&amp;#39;t work and I discovered that is related to bsp_btn config. I deleted this function and it works :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//    bsp_btn_ble_on_ble_evt(p_ble_evt);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now after i discovered the source of the problem , I take back my driver layer,, which is the code i attached in the question and it dosen&amp;#39;t work :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Prbolem , Clock dosen't work</title><link>https://devzone.nordicsemi.com/thread/76852?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2017 14:27:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8ec7756-a7f5-41e1-b350-803320b8a3ba</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Does it work if you comment out the int enable line?:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//nrf_spim_int_enable(&amp;amp;stSPI_iNRF_SPI_Type, ...);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In that case have you written the SPIM irq handler or do you use the one in the SDK? Using the one in the SDK will probably cause troubles.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>