<?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>Connecting nRF52840 DK to MC3672 Accelerometer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70055/connecting-nrf52840-dk-to-mc3672-accelerometer</link><description>Hi, 
 I&amp;#39;m new to building circuits with Nordic devices and am unsure about how to connect the MC3672 accelerometer: https://mcubemems.com/wp-content/uploads/2020/03/EV3672AB-Quick-Start-Guide-and-Demo-APS-045-0017v1.5.pdf to the nRF52840 DK via I2C/SPI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Mar 2021 09:37:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70055/connecting-nrf52840-dk-to-mc3672-accelerometer" /><item><title>RE: Connecting nRF52840 DK to MC3672 Accelerometer</title><link>https://devzone.nordicsemi.com/thread/298935?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 09:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e57da54c-f2af-4038-9171-b401e2c375c1</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;So the first thing you should do is to test and understand the&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_nus_eval.html?cp=7_1_4_2_2_25"&gt; NUS example&lt;/a&gt; in the SDK. It transmit data it has received from UART over BLE. The NUS peripheral example also has a &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_nus_c.html?cp=7_1_4_2_0_7"&gt;NUS Central example&lt;/a&gt;&amp;nbsp;that you can flash to a device that acts as a Central. That way you have a BLE link that can get data from serial com send it over BLE to another device that outputs the data over serial. After you have tested the example you should replace the UART with the SPI/I2C.&amp;nbsp;I&amp;#39;m certain that this has been done before in this forum. Search the forum on already existing threads regarding this. If you want to communicate through the USB peripheral on the dongle instead of the UART pins than the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/usbd_ble_uart_example.html?cp=7_1_4_6_50_1"&gt;USBD BLE UART example&lt;/a&gt; is the one you should use.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Next, you would want to port the NUS example that you&amp;#39;re going to run on the computer side to the Dongle. None of the previous mentioned examples supports the Dongle &amp;quot;straight-out-of-the-box&amp;quot;. You would have to convert the example so that it uses the correct board file and preprocessor settings. &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;Luckily, we have already made a tutorial on this&lt;/a&gt;, so it shouldn&amp;#39;t be a big thing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Some threads that you could be of help along the way&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/47213/nrf-dongle-stops-after-impementing-ble_nus"&gt;nRF Dongle stops after impementing ble_nus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/71575/nrf52840-dongle-usb-pins-usable-for-uart/294177#294177"&gt;nRF52840 Dongle USB Pins usable for uart?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/adding-custom-commands-to-a-ble-example-using-nordic-uart-service"&gt;Adding custom commands to a BLE example using Nordic UART Service&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;regards&lt;br /&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting nRF52840 DK to MC3672 Accelerometer</title><link>https://devzone.nordicsemi.com/thread/298860?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 22:23:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21e23141-e335-4275-b650-1d059a760de0</guid><dc:creator>Jaz</dc:creator><description>&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m thinking of using the nRF52840 dongle attached to my Mac for the PC side, then have the DK and accelerometer as a separate circuit as previously mentioned. The accelerometer data would be transferred to the dongle via BLE and then to my Mac through the USB port. I&amp;#39;d be grateful if you could point me to example&amp;nbsp;code&amp;nbsp;similar to this? I&amp;#39;m just not sure about where to begin in terms of interfacing the accelerometer with the DK, any examples or pieces of code would be appreciated!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting nRF52840 DK to MC3672 Accelerometer</title><link>https://devzone.nordicsemi.com/thread/298581?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 08:30:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98c09478-4b87-4081-b476-31d6b414156e</guid><dc:creator>Jared</dc:creator><description>[quote user="Jaz"]&lt;p&gt;Thanks for the information. I&amp;#39;ve been reading through the TWI and SPI examples and the SPI Slave example looks like it might be suitable for my application:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Ftwi_sensor_example.html&amp;amp;cp=7_1_4_6_43"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Ftwi_sensor_example.html&amp;amp;cp=7_1_4_6_43&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, I&amp;#39;m unsure as to what it means by hardware configuration statements such as:&lt;/p&gt;
&lt;p&gt;&amp;#39;Slave SCLK pin must be connected to Master SCLK.&lt;/p&gt;
&lt;p&gt;Slave CS pin must be connected to Master CS.&lt;/p&gt;
&lt;p&gt;Slave MOSI pin must be connected to Master MOSI.&lt;/p&gt;
&lt;p&gt;Slave MISO pin must be connected to Master MISO.&amp;#39;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve looked through section 1.4 of my accelerometer&amp;#39;s data sheet and assuming it&amp;#39;s the slave in this case, I&amp;#39;ve come to understand that the relevant pin names: &amp;#39;SCLK, CS, MOSI, MISO&amp;#39; in the nRF52840 SPI Slave example correspond to the pin names: &amp;#39;SCL, SCS, SDA, SDO&amp;#39; for the accelerometer, respectively. Is that correct? I&amp;#39;ve attached the data sheet in case you&amp;#39;re able to have a look and point me in the right direction, it would be greatly appreciated:&amp;nbsp;&lt;a href="https://mcubemems.com/wp-content/uploads/2020/03/EV3672AB-Quick-Start-Guide-and-Demo-APS-045-0017v1.5.pdf"&gt;https://mcubemems.com/wp-content/uploads/2020/03/EV3672AB-Quick-Start-Guide-and-Demo-APS-045-0017v1.5.pdf&lt;/a&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes, that is correct. Slaves that use the same pins for both SPI and TWI(I2C) usually use that kind of naming convention.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Jaz"]&lt;p&gt;I&amp;#39;m aiming to use only one nRF52840 DK and to connect it to the accelerometer mounted on a breadboard so that the DK can transmit output values to my Mac via BLE. Would you say this is feasible?&lt;/p&gt;
&lt;p&gt;Most examples include the use of two DKs. For example, in step 3 of testing the SPI Slave example I&amp;#39;m prompted to &amp;#39;Connect the board to another board that runs the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/spi_master_example.html"&gt;SPI Master Example&lt;/a&gt;&amp;#39; but I&amp;#39;m using a single board so I&amp;#39;m unsure if this example will work. Do you know of any examples that use a single nRF52840 board to communicate directly to a target PC/Mac?&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;Feasible Yes, not sure how you would do it though. You would have to implement the PC side yourselves, as all of our reference design, examples etc expects the PC side to be connected to a Nordic device. It isn&amp;#39;t as easy as just connecting to the device via BLE, you have to make a program that can access the BLE on your PC, connect to the peripheral and read the characteristics.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Good luck.&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting nRF52840 DK to MC3672 Accelerometer</title><link>https://devzone.nordicsemi.com/thread/298490?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 17:18:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:988f23a7-26a2-43f8-b8fc-ccb78d59e7d3</guid><dc:creator>Jaz</dc:creator><description>&lt;p&gt;Hi Jared,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the information. I&amp;#39;ve been reading through the TWI and SPI examples and the SPI Slave example looks like it might be suitable for my application:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Ftwi_sensor_example.html&amp;amp;cp=7_1_4_6_43"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Ftwi_sensor_example.html&amp;amp;cp=7_1_4_6_43&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, I&amp;#39;m unsure as to what it means by hardware configuration statements such as:&lt;/p&gt;
&lt;p&gt;&amp;#39;Slave SCLK pin must be connected to Master SCLK.&lt;/p&gt;
&lt;p&gt;Slave CS pin must be connected to Master CS.&lt;/p&gt;
&lt;p&gt;Slave MOSI pin must be connected to Master MOSI.&lt;/p&gt;
&lt;p&gt;Slave MISO pin must be connected to Master MISO.&amp;#39;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve looked through section 1.4 of my accelerometer&amp;#39;s data sheet and assuming it&amp;#39;s the slave in this case, I&amp;#39;ve come to understand that the relevant pin names: &amp;#39;SCLK, CS, MOSI, MISO&amp;#39; in the nRF52840 SPI Slave example correspond to the pin names: &amp;#39;SCL, SCS, SDA, SDO&amp;#39; for the accelerometer, respectively. Is that correct? I&amp;#39;ve attached the data sheet in case you&amp;#39;re able to have a look and point me in the right direction, it would be greatly appreciated:&amp;nbsp;&lt;a href="https://mcubemems.com/wp-content/uploads/2020/03/EV3672AB-Quick-Start-Guide-and-Demo-APS-045-0017v1.5.pdf"&gt;https://mcubemems.com/wp-content/uploads/2020/03/EV3672AB-Quick-Start-Guide-and-Demo-APS-045-0017v1.5.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://mcubemems.com/wp-content/uploads/2020/02/MC3672-Datasheet-APS-045-0018v1.3.pdf"&gt;&lt;/a&gt;I&amp;#39;m aiming to use only one nRF52840 DK and to connect it to the accelerometer mounted on a breadboard so that the DK can transmit output values to my Mac via BLE. Would you say this is feasible?&lt;/p&gt;
&lt;p&gt;Most examples include the use of two DKs. For example, in step 3 of testing the SPI Slave example I&amp;#39;m prompted to &amp;#39;Connect the board to another board that runs the &lt;a class="el" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/spi_master_example.html"&gt;SPI Master Example&lt;/a&gt;&amp;#39; but I&amp;#39;m using a single board so I&amp;#39;m unsure if this example will work. Do you know of any examples that use a single nRF52840 board to communicate directly to a target PC/Mac?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting nRF52840 DK to MC3672 Accelerometer</title><link>https://devzone.nordicsemi.com/thread/287284?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 14:27:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7edfb05-eaaa-4843-857c-fe1c1d6d60e9</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First you would have to decide on what serial interface that you would like to use.&lt;/p&gt;
&lt;p&gt;Secondly, depending on what serial interface you chose, you should test and understand either the&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/twi_sensor_example.html?cp=7_1_4_6_43"&gt; TWI(I2C)&lt;/a&gt;&amp;nbsp;or the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/spi_master_example.html?cp=7_1_4_6_37"&gt;SPI&lt;/a&gt;&amp;nbsp;example.&lt;/p&gt;
&lt;p&gt;The TWI example uses pin 27 and 26 by default, and it&amp;#39;s set in the twi_init() function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void twi_init (void)
{
    ret_code_t err_code;

    const nrf_drv_twi_config_t twi_lm75b_config = {
       .scl                = ARDUINO_SCL_PIN, //Pin 27
       .sda                = ARDUINO_SDA_PIN, // Pin 26
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_lm75b_config, twi_handler, NULL);
    APP_ERROR_CHECK(err_code);

    nrf_drv_twi_enable(&amp;amp;m_twi);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, I would suggest that you read a previous thread where we discussed the TWI driver &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/65273/nrf52840---sdk16---understanding-twi-driver/266919#266919"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>