<?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>TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43717/twi-and-ble-on-nrf52840-dk</link><description>Hello, 
 I am interfacing nRF52840 DK with the MAX30101 sensor. I am able to execute all the TWI transactions necessary by using port 0 pin 27 as SCL and port 0 pin 26 as SDA. 
 However when i use port 0 pin 14 as SCL and port 0 pin 13 as SDA I am not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Jun 2019 15:25:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43717/twi-and-ble-on-nrf52840-dk" /><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192462?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 15:25:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4a6a262-b8b8-4e2e-861f-d872874730ec</guid><dc:creator>gauthamranganathan</dc:creator><description>&lt;p&gt;do you have a nRF development board? if you do then you can run your software on the Dev board and check if the TWI transmits are working properly. Else you might have to solder wires on the custom board and check on the scope.&lt;/p&gt;
&lt;p&gt;Also have you placed the recommended pull resistors on the bus?&amp;nbsp; Also make sure the logic level of the two ( max30101 (this will be decided by one the voltage pins) and nRF) match.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192343?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 11:55:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1707a2a5-db34-43bf-9fac-d3580958f152</guid><dc:creator>Muhammad Nabeel</dc:creator><description>&lt;p&gt;No, I did not verify. I made my own board and I tested the sensor with arduino and I am getting the values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192337?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 11:50:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:742beaac-e041-4191-ab0d-34494fc00949</guid><dc:creator>gauthamranganathan</dc:creator><description>&lt;p&gt;Have you verified the master transmits using logic analyser/ scope? Are you using breakout board of max30101 from mikroE?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192334?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 11:48:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71f4c016-a50a-499b-b72a-6df13f1c2e42</guid><dc:creator>Muhammad Nabeel</dc:creator><description>&lt;p&gt;static const nrf_drv_twi_t twi_ins=NRF_DRV_TWI_INSTANCE(TWI0_INSTANCE_INDEX);&amp;nbsp; &amp;nbsp; &amp;nbsp;// nRF TWI instance initialization&lt;/p&gt;
&lt;p&gt;setup(&amp;amp;twi_ins);&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192304?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 09:38:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db02a1af-e695-4b89-8a1b-f064e61aa84b</guid><dc:creator>gauthamranganathan</dc:creator><description>&lt;p&gt;1. please post the macros containing the values loaded the register&lt;/p&gt;
&lt;p&gt;2.. nrf_drv_twi_tx/rx commands require a pointer to the instance. Can i see how you&amp;nbsp;called the setup function?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;3. I think there are some drivers on os mbed. please have a look at max30101 repos on osmbed.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192226?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 07:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bce4d793-3520-4050-8142-5b6ad1580a3c</guid><dc:creator>Muhammad Nabeel</dc:creator><description>&lt;p&gt;I have tried to follow the sparkfun library for Arduino and used MAX30101 Address as 0x57 as used in library&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192220?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 07:18:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30de17bb-8bdd-4026-a792-5739e8d8ef99</guid><dc:creator>Muhammad Nabeel</dc:creator><description>&lt;p&gt;Functions that I have used to get data from FIFO are following&lt;pre class="ui-code" data-mode="c_cpp"&gt;
/**@brief Function for reading the MAX30101_FIFOREADPTR register .
 *
 * @param[in] p_instance  TWI instance.
*/
uint8_t getRDptr(nrf_drv_twi_t const * p_instance)
{
	uint8_t data;
	regread8(p_instance,MAX30101_FIFOREADPTR,&amp;amp;data,true);
	return data;
}

/**@brief Function for reading the MAX30101_FIFOWRITEPTR register .
 *
 * @param[in] p_instance  TWI instance.
*/
uint8_t getWRptr(nrf_drv_twi_t const * p_instance)
{
	uint8_t data;
	regread8(p_instance,MAX30101_FIFOWRITEPTR,&amp;amp;data,true);
	return data;
}

/**@brief Function for reading the data from FIFO buffer .
 *
 * @param[in] p_instance  TWI instance.
*/
uint8_t *getdata(nrf_drv_twi_t const * p_instance)
{
	uint8_t wrptr=0;
	uint8_t rdptr=0;
	uint8_t scount=0; //Number of samples to be read from the sensor
	static uint8_t data[3];
	wrptr= getWRptr(p_instance); // FIFO_WR pointer 
	rdptr= getRDptr(p_instance); // FIFO_RD pointer
	scount =wrptr-rdptr;
	if(scount&amp;lt;0)scount+=32;
	nrf_drv_twi_tx(p_instance, MAX30101_ADDRESS, &amp;amp;MAX30101_FIFODATA, sizeof(MAX30101_FIFODATA), true);
	nrf_delay_ms(1);
	for(int i=0; i&amp;lt;scount;i++)
	{
		nrf_drv_twi_rx(p_instance, MAX30101_ADDRESS, &amp;amp;data[2], 1/*Read only 1 byte*/);
		nrf_delay_ms(1);
		nrf_drv_twi_rx(p_instance, MAX30101_ADDRESS, &amp;amp;data[1], 1);
		nrf_delay_ms(1);
		nrf_drv_twi_rx(p_instance, MAX30101_ADDRESS, &amp;amp;data[0], 1);
		nrf_delay_ms(1);
	}
	
	return data;
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192217?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 07:13:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f4da239-e8b2-4ade-8f9c-8628a61dec45</guid><dc:creator>Muhammad Nabeel</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for initializations of max30101 .
 *
 * @param[in] p_instance  TWI instance.
*/
void setup(nrf_drv_twi_t const * p_instance)
{
	 
		//Setting the Mode configuration register
		regwrite8(p_instance,MAX30101_MODECONFIG, MAX30101_MODE_MULTILED); // Setting the mode to Multi LED i-e 0x07

	   // Multi Led mode control configuration register setup for slotx
    regwrite8(p_instance,MAX30101_MULTILEDCONFIG1,MULTI_LED_1); // Register 0x11 setup to value 0x21
	
		regwrite8(p_instance,MAX30101_MULTILEDCONFIG2,MULTI_LED_3); // Register 0x12 setup to value 0x03
	
		//LED Pulse applitude register to set the current in the led	
		regwrite8(p_instance,MAX30101_LED1_PULSEAMP,powerLevel); // Current register setup to value 0x1F
		regwrite8(p_instance,MAX30101_LED2_PULSEAMP,powerLevel);
		regwrite8(p_instance,MAX30101_LED3_PULSEAMP,powerLevel);


  
 // Configuration register setting
	/*
	*	Fifo roll over enabled
	*	Fifo sample average to 4
	*	Generate Interrupt when 29 samples are filled in memeory
	*/
		regwrite8(p_instance,MAX30101_FIFOCONFIG,MAX30101_CONF_FIFO);// Fifo configuration register setup
	
		// Spo2 Configuration setup 
		/*
		*	ADC range set to 4096
		* Sample Rate 400
		*	LED pulse width 411
		*/
		regwrite8(p_instance,MAX30101_PARTICLECONFIG,0x2F);
		// Clear fifo
		clearFIFO(p_instance);
	
}

/**@brief Function for writing the data to max30101 .
 *
 * @param[in] p_instance  TWI instance.
 * @param[in] RegAddr     Register Address to be written.
 * @param[in] data        Data to be written to the register.
 */
void regwrite8(nrf_drv_twi_t const * p_instance, uint8_t RegAddr, uint8_t data)
{
	uint8_t reg[2] = {RegAddr, data};
	nrf_drv_twi_tx(p_instance, MAX30101_ADDRESS, reg, sizeof(reg), false); //Repeated start is disabled
	nrf_delay_ms(5);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Code to Initialize the sensor&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192203?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 05:24:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfc119d1-fb20-4767-9f3c-4cb062edf322</guid><dc:creator>gauthamranganathan</dc:creator><description>&lt;p&gt;Hi Muhammad,&amp;nbsp;&lt;br /&gt;Sure, i can help you. can you tell me your configuration values?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/192126?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2019 14:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:981a3b3c-4e52-40d4-9e76-9c2d127a0e90</guid><dc:creator>Muhammad Nabeel</dc:creator><description>&lt;p&gt;Hi Gautham,&lt;/p&gt;
&lt;p&gt;I am working on similar boards, I have configured the sensor correctly but when I read FIFO I get zero. Can you help me out with configurations?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/172362?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 16:52:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fca3304-71e0-4054-a761-95925d7a7487</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;You should be able to do that if you don&amp;#39;t initialize the buttons and lEDs. Remove&amp;nbsp;buttons_leds_init(&amp;amp;erase_bonds) from main.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/172149?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 14:41:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd5e9ee6-6658-42f1-a194-9523a7275a48</guid><dc:creator>gauthamranganathan</dc:creator><description>&lt;p&gt;I would like to disable the LEDs and BUTTONS on the ble_app_uart example. There seems to be some dependency with the leds and buttons with the ble functions. Could you tell me how i can remove these dependencies?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/172144?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 14:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7361f81-1ad9-46a7-a5b5-c10c6988aea3</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You could either change the pins used in the ble_app_uart example to unused pins or make changes to the DK.&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t need LED1 and LED2 and prefer to use P0.13 and P0.14, you can disconnect the LEDs by cutting the solder bridge(Have a look at &lt;a href="https://www.nordicsemi.com/DocLib/Content/User_Guides/nrf52840_dk/latest/UG/nrf52840_DK/hw_buttons_leds#hw_buttons_leds__fig_uk2_mjn_jdb" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/171271?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 04:24:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98cadb7b-9b40-4811-8f28-4816e3d3acde</guid><dc:creator>gauthamranganathan</dc:creator><description>&lt;p&gt;yes, What changes should I make to the ble_app_uart example (SDK15.2) to get this working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/171187?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 15:01:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:937373f6-0715-4a2a-b78e-cb2730cab717</guid><dc:creator>Fredrik</dc:creator><description>&lt;p&gt;P0.13 and P0.14 are connected to LED1 and LED2 on the nRF52840 DK, respectively, see &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52%2Fdita%2Fnrf52%2Fdevelopment%2Fnrf52840_pdk%2Fconnector_if.html"&gt;here&lt;/a&gt;. You will need to find unused pins, or adapt the DK to work for your purposes. This would of course not be a problem in a custom PCB design.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and BLE on nRF52840 DK</title><link>https://devzone.nordicsemi.com/thread/171121?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 12:19:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68645257-d1ee-4c50-ac74-5aa006eabf7f</guid><dc:creator>gauthamranganathan</dc:creator><description>&lt;p&gt;If&amp;nbsp; i perform twi_init before&amp;nbsp; bsp_buttons_leds function then TWI is working. But if i place it after it does not.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>