<?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>I can not receive the data from the peripherical slave device(MAX6675)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15801/i-can-not-receive-the-data-from-the-peripherical-slave-device-max6675</link><description>Hi,
I write a code for the max6657 temperture via modifying the SPI MASTER Example. The function for reading max6675 via SPI is shown as follow 
 uint16_t readCelsius(void){
uint16_t flag;
uint16_t temp;
uint16_t tempc;
uint32_t spi_rw_err_code;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Aug 2016 04:38:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15801/i-can-not-receive-the-data-from-the-peripherical-slave-device-max6675" /><item><title>RE: I can not receive the data from the peripherical slave device(MAX6675)</title><link>https://devzone.nordicsemi.com/thread/60296?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2016 04:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcda4d6e-f3dd-4c1a-aaa5-9a12999edae5</guid><dc:creator>kaochin</dc:creator><description>&lt;p&gt;yes, you are right. This problem is caused by the power of the borad. I have solved the problem via providing a external power the sesor. Thank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can not receive the data from the peripherical slave device(MAX6675)</title><link>https://devzone.nordicsemi.com/thread/60293?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 14:53:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c788e95f-38c2-4d6c-81fd-2f68c8382872</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Yes, you should wait for the event handler to be executed with the NRF_DRV_SPI_EVENT_DONE event. You should also make the rx buffer global or static such that it is placed in RAM rather than on the stack.&lt;/p&gt;
&lt;p&gt;But if you still don&amp;#39;t see anything on the data lines (but on the clock line) with the logic analyzer, then the problem is with the connection to the chip, not with the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can not receive the data from the peripherical slave device(MAX6675)</title><link>https://devzone.nordicsemi.com/thread/60295?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 14:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a8a7225-0820-49f4-a07f-e23a42cd76e3</guid><dc:creator>kaochin</dc:creator><description>&lt;p&gt;The max6675 is work correctly in both of the STM32 and arduino。&lt;/p&gt;
&lt;p&gt;I have assigned a even handler function in the initial function just as the SPI MASTER Example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    void spi_event_handler(nrf_drv_spi_evt_t const * p_event){
spi_xfer_done = true;
NRF_LOG_PRINTF(&amp;quot; Transfer completed.\r\n&amp;quot;);}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think that the blocking SPI is not used in my code. So,Shall I need to wait for the NRF_DRV_SPI_EVENT_DONE event? I will check it in my code! But I think that it is done in the handle function, is&amp;#39;nt it?&lt;/p&gt;
&lt;p&gt;Thank for your suggest!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can not receive the data from the peripherical slave device(MAX6675)</title><link>https://devzone.nordicsemi.com/thread/60294?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 13:54:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b03fd2ac-dfe2-4d96-84f8-23f78dd49bec</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;From the logic analyzer capture it looks like you actually are actually receiving 0x0000, which indicates that the problem is with the other chip or the connection with the other chip. Have you tested that it works with another chip as master, for example an Arduino?&lt;/p&gt;
&lt;p&gt;Do you use blocking SPI (no event handler passed in the init function)? I assume you are using blocking SPI since it works with the STM chip, but If you are not using blocking SPI then you need to wait for the NRF_DRV_SPI_EVENT_DONE event before the data is valid.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>