<?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 Packet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16790/spi-packet</link><description>I want to use ATMEGA 328 to send a packet over to the chip as follows: 
 SPDR = packet ; 
 Can some one kindly post what the content of this packat should be ?
is it possible to transfer a 32 Byte packet in this way to the BLE chip ? 
 Thanks in advance</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Oct 2016 07:50:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16790/spi-packet" /><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64243?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 07:50:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41ca7586-8b83-47bb-8b5d-b744524f4be5</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;See section 7.1.2 for the SPI mode, the data order is Least Significant bit first so take care of it in the SPI master settings.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64246?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 07:46:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f82029bd-9d11-4cad-8f77-b7f9e1d17703</guid><dc:creator>user123x</dc:creator><description>&lt;p&gt;This one  was simple. Just had to read the bits in the other order. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64245?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 07:45:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5cdd54b-789c-492f-9b67-9036670a948b</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;0x81 is the DeviceStarted Event but the rest of the parameters does not fit, verify your SPI settings.
You have some help in the optiboot port for the nRF8001 on AVR
&lt;a href="https://github.com/NordicSemiconductor/ble-optiboot/blob/40e4283d081866bf5f280dd68ac8cebefe9d1919/BLE/hal_aci_tl.c"&gt;github.com/.../hal_aci_tl.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64240?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 07:34:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77a7f20c-877b-4ebb-9ff2-24c40a00f9d2</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;Sections 7.1.4 and section 7.1.5 provides the packet format and the section 7 provides the handshake details. The debug byte needs to be discarded.
If you do not have a command to transmit but there is an event for you to process, you need to send packet with the length byte set to zero, (I suspect this is the dummy bits you are talking about)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64244?ContentTypeID=1</link><pubDate>Sat, 08 Oct 2016 09:45:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7b87247-5df4-4dcb-adda-038d1186d1aa</guid><dc:creator>user123x</dc:creator><description>&lt;p&gt;When I start up SPI communication with the nrf8001, I get the following event:&lt;/p&gt;
&lt;p&gt;0X81
0X40
0X00
0X40&lt;/p&gt;
&lt;p&gt;I am wondering if some one knows what 0x40 codes for ?&lt;/p&gt;
&lt;p&gt;Could not find it in the data sheet ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64242?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 23:27:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:691e5432-3583-4400-b149-f34c4db36c63</guid><dc:creator>user123x</dc:creator><description>&lt;p&gt;I think I have figured out the send packet:&lt;/p&gt;
&lt;p&gt;COMMAND PART:&lt;/p&gt;
&lt;p&gt;For example you want to read Temp: (this works in every mode)&lt;/p&gt;
&lt;p&gt;The SPI transmission should consist of 2 bytes:   Lenght and Command.&lt;/p&gt;
&lt;p&gt;SS Pulled low.
Wait for handshake : RDYN gets pulled low.
SPDR = 0X01;
wait for transmission to complet.
SPDC = 0X0C;
wait for transmission to complete.&lt;/p&gt;
&lt;p&gt;SS Pulled up.
RDYN goes back up. Transmission complete.&lt;/p&gt;
&lt;p&gt;EVENT PART (Response from the nRF8001):&lt;/p&gt;
&lt;p&gt;RDNY gets pulled low, trigger interrupt and pully SS low. Then start sending some kind of dummy bits (dont know what this should be) to the nRF8001 to get the SPI transmission from the nRF:&lt;/p&gt;
&lt;p&gt;The resulting read on the SPDR after every dummy transmit should look as follows:&lt;/p&gt;
&lt;p&gt;Byte 0: Debug Byte (dont know what this is)
Byte 1: 0X04  (legnth of packet in numer of bytes (excluding this byte) and byte 0)
Byte 2: 0X84  (Event Type : command response)
Byte 3: 0x0C  (Temp Read command)
Byte 4: 0x00 (success status)
Byte 5: 0X0A     ( value to be div by 4, i.e. this reads 2.5°C)&lt;/p&gt;
&lt;p&gt;As you can see there are still some gaps in my unerstanding of the &amp;quot;Event&amp;quot; part of the communication. May be there is some expert out there who has figured this out much better than me.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64239?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 23:26:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:999a86d9-929c-4797-b4c1-7f9959a83dfe</guid><dc:creator>user123x</dc:creator><description>&lt;p&gt;I think I have figured out the send packet:&lt;/p&gt;
&lt;p&gt;COMMAND PART:&lt;/p&gt;
&lt;p&gt;For example you want to read Temp: (this works in every mode)&lt;/p&gt;
&lt;p&gt;The SPI transmission should consist of 2 bytes:   Lenght and Command.&lt;/p&gt;
&lt;p&gt;SS Pulled low.
Wait for handshake : RDYN gets pulled low.
SPDR = 0X01;
wait for transmission to complet.
SPDC = 0X0C;
wait for transmission to complete.&lt;/p&gt;
&lt;p&gt;SS Pulled up.
RDYN goes back up. Transmission complete.&lt;/p&gt;
&lt;p&gt;EVENT PART (Response from the nRF8001):&lt;/p&gt;
&lt;p&gt;RDNY gets pulled low, trigger interrupt and pully SS low. Then start sending some kind of dummy bits (dont know what this should be) to the nRF8001 to get the SPI transmission from the nRF:&lt;/p&gt;
&lt;p&gt;The resulting read on the SPDR after every dummy transmit should look as follows:&lt;/p&gt;
&lt;p&gt;Byte 0: Debug Byte (dont know what this is)
Byte 1: 0X04  (legnth of packet in numer of bytes (excluding this byte) and byte 0)
Byte 2: 0X84  (Event Type : command response)
Byte 3: 0x0C  (Temp Read command)
Byte 4: 0x00 (success status)
Byte 5: 0X0A     ( value to be div by 4, i.e. this reads 2.5°C)&lt;/p&gt;
&lt;p&gt;As you can see there are still some gaps in my unerstanding of the &amp;quot;Event&amp;quot; part of the communication. May be there is some expert out there who has figured this out much better than me.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;However the &amp;quot;event packet&amp;quot; has a &amp;quot;debug byte&amp;quot; in the header of the packet, which gets discarded. Does any one know what this is ?&lt;/p&gt;
&lt;p&gt;Does this &amp;quot;debug byte&amp;quot; get generated every time even when the connection is successful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64238?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 14:45:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6c896e7-448f-4f74-b5f3-152a437a5223</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Thanks Awneil, I wasn&amp;#39;t aware of that ACI command :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64237?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 10:40:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6070774a-149c-4aba-b5e5-5dbe49b61685</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;ECHO is an ACI command.&lt;/p&gt;
&lt;p&gt;The SDK includes an ECHO example - ble_aci_transport_layer_verification:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/**
 * echo project to verify the SPI/ACI connectivity
 */

/** @defgroup my_project my_project
@{
@ingroup projects
@brief Echo project to loop data from the mcu to the nRF800 and back

@details
This project is a test project to verify the SPI/ACI.
The data in the ACI echo command send and the data
received in the ACI echo event should be the same.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64234?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 09:05:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9eacc42d-619f-48d1-81f9-eb8cc26fdb7e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@user123x: What do you mean by ECHO ? what do you want to do with the nRF8001 ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64235?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 11:44:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:255a7303-aee1-4088-857f-df6a356fabd2</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Seriously: the whole point of the SDK is to save you from having to work out the arcane details of the packet bytes by hand.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re not able to do it yourself, then let the SDK do it for you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64236?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 11:25:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3141500-e604-4164-95f9-cbd87eebe098</guid><dc:creator>user123x</dc:creator><description>&lt;p&gt;I have read the entire documentation. However I still dont have a sample packet. How should it be coded can you give an example. What does this packet look like . Lets say it has 3 bytes:&lt;/p&gt;
&lt;p&gt;LEN : ECHO: DATA
0x03 0x02 0x01&lt;/p&gt;
&lt;p&gt;How do I send it via SPI line ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64233?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 10:25:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d65d861f-ed60-4d75-942c-3aa8a08910eb</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you want to interface with the nRF8001, you may want to have a look in the nRF8001 spec.
Chapter 7 Interfaces, and from chapter 18 to 27 are important to know how it works (how to interface your MCU with nRF8001).&lt;/p&gt;
&lt;p&gt;It&amp;#39;s actually good idea to follow what we do in the &lt;a href="https://github.com/NordicSemiconductor/ble-sdk-arduino"&gt;Arduino SDK&lt;/a&gt; as Awneil pointed out.&lt;/p&gt;
&lt;p&gt;We also provided the &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF8001-SDK"&gt;SDK for nRF8001&lt;/a&gt; but using our own MCU (nRF8200). It may not as similar to Atmel chip as the Arduino&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64232?ContentTypeID=1</link><pubDate>Sun, 02 Oct 2016 16:47:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a839776-b0ab-4d1c-bc3c-479833d757ab</guid><dc:creator>user123x</dc:creator><description>&lt;p&gt;Sorry but the SDK does not answer my comment. Can you please clarify how the packet looks like ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64231?ContentTypeID=1</link><pubDate>Sun, 02 Oct 2016 16:38:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a23f6a3-0fce-411e-a7d3-efc36bcbebd5</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;strong&gt;Use the SDK&lt;/strong&gt;: &lt;a href="https://github.com/NordicSemiconductor/ble-sdk-arduino"&gt;github.com/.../ble-sdk-arduino&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64230?ContentTypeID=1</link><pubDate>Sun, 02 Oct 2016 16:12:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71a7149c-6590-4359-813c-b73f96e38a49</guid><dc:creator>user123x</dc:creator><description>&lt;p&gt;The Chip is :  nRF8001&lt;/p&gt;
&lt;p&gt;Would this packet work :   0X03 0x02 0x01 ?&lt;/p&gt;
&lt;p&gt;Will it generate an echo of 0X01 ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64229?ContentTypeID=1</link><pubDate>Sun, 02 Oct 2016 13:58:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1432eab-e9fe-43be-89c8-e9c151afa83f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Why have you posted this as an &lt;strong&gt;Answer&lt;/strong&gt;? It&amp;#39;s not an Answer - it&amp;#39;s a &lt;strong&gt;Comment!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You haven&amp;#39;t said what BLE Chip you are using - so it is impossible to answer your question!&lt;/p&gt;
&lt;p&gt;But the details will be in the &lt;strong&gt;Documentation&lt;/strong&gt; for whatever BLE chip you&amp;#39;re using - so you will need to study that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64228?ContentTypeID=1</link><pubDate>Sun, 02 Oct 2016 13:38:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98386bbe-c6fe-49db-a383-db5303fdb4eb</guid><dc:creator>user123x</dc:creator><description>&lt;p&gt;Thanks for your response. But my question is still:&lt;/p&gt;
&lt;p&gt;I am using the ATMEL 328 as Master to control the BLE Chip.&lt;/p&gt;
&lt;p&gt;I have configured it as a master and I want to send a packet to the BLE chip to test if it works:&lt;/p&gt;
&lt;p&gt;How should this packet look, what should I read into SPDR ?&lt;/p&gt;
&lt;p&gt;I want to know the content of the packet that needs to be sent across to test the chip.&lt;/p&gt;
&lt;p&gt;Also when reading back from the chip, will it automatically pull the SS (RDYN) low or does it have to be done in software ?&lt;/p&gt;
&lt;p&gt;Thanks for your kind response.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Packet</title><link>https://devzone.nordicsemi.com/thread/64241?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 21:19:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a51f6d58-b53d-444a-82cb-49a02a23d332</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;The ATMega328 is an &lt;strong&gt;Atmel&lt;/strong&gt; (now Microchip) product - it has nothing to do with Nordic.&lt;/p&gt;
&lt;p&gt;You will need to study the &lt;strong&gt;Datasheet&lt;/strong&gt; and other documentation provided by &lt;strong&gt;Atmel&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.atmel.com/devices/atmega328.aspx"&gt;www.atmel.com/.../atmega328.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In particular, look at the &amp;#39;&lt;strong&gt;Documents&lt;/strong&gt;&amp;#39; tab: as the name suggests, it has many documents about using the ATMega328 - including its SPI features...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>