<?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>Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96319/recording-2channel-analogue-signal-nrf52832</link><description>Hello, I am trying to record the analog signal by using NRF52832. 
 The problem is, when I record the signal only with one channel, the signal looks very fine, up to a 2kHz sampling rate. 
 However, if I just added another channel to the code, I lost</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Feb 2023 11:59:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96319/recording-2channel-analogue-signal-nrf52832" /><item><title>RE: Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/thread/410326?ContentTypeID=1</link><pubDate>Thu, 16 Feb 2023 11:59:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e177e43b-1fdf-43d0-ace0-979223c086a0</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;The nRF5 SDK v13 is over 5 years old, and so there is&amp;nbsp;&lt;em&gt;a lot&lt;/em&gt; to gain in terms of features, improvements, and tools.&lt;br /&gt;The nRF Go Studio is also now deprecated.&lt;br /&gt;If it is at all feasible for you to start out from the v17.1.0 (if you want to continue working with the nRF5 SDK, and not are interested in future features and improvements), or the latest nRF Connect SDK, then I would highly recommend this! :)&lt;/p&gt;
[quote user="Pivot"]So, since my code was modified from the relatively old version of SDK (heart rate measurement example), is it hard to fix it from the code I uploaded?[/quote]
&lt;p&gt;If you were to add this functionality to your nRF5 SDK v13 based application you would have to use the github example I shared earlier as a reference, since the same APIs likely are not available in the v13, but the overall approach/functions should be similar, more or less.&lt;br /&gt;&lt;br /&gt;If your application is very similar to the Heart Rate Measurement example then you could upgrade to the newer version by re-implementing your custom features in the newer Heart Rate Measurement versions.&lt;br /&gt;&lt;br /&gt; Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/thread/410162?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2023 17:29:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c00ff3db-d0bb-4fb8-a5f8-01631bb58fd4</guid><dc:creator>hyhaerong</dc:creator><description>&lt;p&gt;It is only because we used to work with this.&lt;/p&gt;
&lt;p&gt;Modify the code from SDK 13, load the code to the DVK through Keil, and write the code into the chip with nRFgoStudio.&lt;/p&gt;
&lt;p&gt;As far as I can run my code to the DVK and port it on the empty IC chip, it doesn&amp;#39;t matter.&lt;/p&gt;
&lt;p&gt;So, since my code was modified from the relatively old version of SDK (heart rate measurement example), is it hard to fix it from the code I uploaded?&lt;/p&gt;
&lt;p&gt;The only worry I have is making a try at what I am unfamiliar with.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/thread/410021?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2023 09:44:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49142a0f-7c5c-4365-8b0b-7cd78a7e5687</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Pivot"]Oh, sorry about the misunderstanding. [/quote]
&lt;p&gt;No need to apologize - I&amp;#39;ll just ask if anything is unclear or needs elaboration :)&amp;nbsp;&lt;/p&gt;
[quote user="Pivot"]&lt;p&gt;I am currently working with SDK 13&lt;br /&gt;I switched m_nus as 0 but still, there are so many errors occurring especially for the header.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Do you think it would be better to start over from the SDK 17.1 SAADC example?&lt;/p&gt;[/quote]
&lt;p&gt;Are you starting a new project with the nRF5 SDK v13? If so, what is the reason for choosing the v13 in particular?&lt;br /&gt;I would always recommend starting a new project with the latest SDK whenever possible.&lt;br /&gt;I would also recommend that you look into the possibility of using the nRF Connect SDK, if it is feasible for you.&lt;br /&gt;If you are not already familiar with the nRF Connect SDK I highly recommend going through the hands-on &lt;a href="https://academy.nordicsemi.com/?utm_campaign=Nordic%20DevAcademy&amp;amp;utm_source=nordicsemi.com%2FSupport%2FNordic-Developer-Academy&amp;amp;utm_content=Nordic%20Developer%20Academy%20portal"&gt;DevAcademy nRF Connect SDK Fundementals course&lt;/a&gt;.&lt;/p&gt;
[quote user="Pivot"]The thing that I need is&lt;br /&gt;1. recording analog channel from the 2 AIN pins with 1kHz sampling rate (no external memory)&lt;br /&gt;2. right after the buffer has been filled, data should be sent to the Bluetooth communication.[/quote]
&lt;p&gt;The example I linked earlier essentially does this for you, if you do not have a requirement to use the nRF5 SDK v13.&lt;br /&gt;Could you clarify on your requirements to the SDK, and whether it could be an option to use the nRF Connect SDK?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/thread/409965?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2023 22:15:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d449244f-bf1d-4699-8210-78b796d19a14</guid><dc:creator>hyhaerong</dc:creator><description>&lt;p&gt;Oh, sorry about the misunderstanding. I am currently working with SDK 13&lt;br /&gt;I switched m_nus as 0 but still, there are so many errors occurring especially for the header.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Do you think it would be better to start over from the SDK 17.1 SAADC example?&lt;/p&gt;
&lt;p&gt;The thing that I need is&lt;br /&gt;1. recording analog channel from the 2 AIN pins with 1kHz sampling rate (no external memory)&lt;br /&gt;2. right after the buffer has been filled, data should be sent to the Bluetooth communication.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/thread/408823?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 11:18:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07a20113-c086-4dc1-9ed0-2239fb19ef8d</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Pivot"]I sincerely appreciate your response.[/quote]
&lt;p&gt;No problem at all, I am happy to help! :)&lt;/p&gt;
[quote user="Pivot"]2. I tried to implant the sample code you gave me, but there is an error message &amp;quot;identifier &amp;quot;m_nus&amp;quot; is undefined&amp;quot; when I compile the code. But I cannot find a line where define &amp;quot;m_nus&amp;quot; from the sample code...&lt;br /&gt;How should I define the &amp;quot;m_nus&amp;quot; in this case?[/quote]
&lt;p&gt;The m_nus in this case is the handle for the Nordic Uart Service (NUS) which is used to transport the measurements over BLE in the provided example.&lt;br /&gt;If you do not intend to use BLE to transfer your measurements you can omit merging the BLE parts of the example to your application.&lt;/p&gt;
[quote user="Pivot"]3. I am not sure what initialization code you want, but I hope this can help.[/quote]
&lt;p&gt;I was thinking about the SAADC initialization, but it is not as important now that we know that you were not using PPI initially.&lt;br /&gt;&lt;br /&gt;Is your code working as expected when you remove the BLE parts from the example?&lt;/p&gt;
[quote user="Pivot"]4. I am working with the Keil V5.28.0[/quote]
&lt;p&gt;Thank you for clarifying! Which version of the nRF5 SDK are you working with?&lt;br /&gt;If you are starting a new project &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;we highly recommend starting with the nRF Connect SDK&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/thread/408710?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2023 23:25:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:261aabfd-a8ca-488b-8d2c-4ddc6b0d59fe</guid><dc:creator>hyhaerong</dc:creator><description>&lt;p&gt;I sincerely appreciate your response.&lt;/p&gt;
&lt;p&gt;1. I don&amp;#39;t think PPI is triggering it, and the situation you told me about would be the exact one I am faced with, I think. It was fine with one-channel recording but not for multi.&lt;/p&gt;
&lt;p&gt;2. I tried to implant the sample code you gave me, but there is an error message &amp;quot;identifier &amp;quot;m_nus&amp;quot; is undefined&amp;quot; when I compile the code. But I cannot find a line where define &amp;quot;m_nus&amp;quot; from the sample code...&lt;br /&gt;How should I define the &amp;quot;m_nus&amp;quot; in this case?&lt;/p&gt;
&lt;p&gt;3. I am not sure what initialization code you want, but I hope this can help.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void heart_rate_meas_timeout_handler(void * p_context)
{
	ret_code_t      err_code;
    UNUSED_PARAMETER(p_context);
		if (AIN_INX == 0){
				err_code = ble_hrs_heart_rate_measurement_send(&amp;amp;m_hrs, InputVal2_buf);
				array_initialize(InputVal2_buf);
				buf1 = 0;
		}
		else{
				err_code = ble_hrs_heart_rate_measurement_send(&amp;amp;m_hrs, InputVal1_buf);
				array_initialize(InputVal1_buf);
				buf0 = 0;
		}

		if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp;
				(err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
				(err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;
				(err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)
			 )
		{
			APP_ERROR_HANDLER(err_code);
		}
		else;


		tmp = 0;
		btmpChk = true;
}


void csense_initialize(void)
{
    ret_code_t err_code;

    nrf_drv_csense_config_t csense_config = { 0 };

#if USE_COMP == 0
    csense_config.output_pin = OUTPUT_PIN;
#endif
    NRF_LOG_INFO(&amp;quot;csense_initialize.\r\n&amp;quot;);

    err_code = nrf_drv_csense_init(&amp;amp;csense_config, csense_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_csense_channels_enable(PAD_1_MASK); | PAD_2_MASK);
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4. I am working with the Keil V5.28.0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Once again, really appreciate your help, and please let me know if there is anything that I can tell you more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/thread/408451?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2023 08:10:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ac6f6e2-a21a-4cd3-a172-fa4a4e44cb31</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Are these SAADC samplings triggered by the CPU directly, or have you set them to trigger through PPI?&lt;br /&gt;If you were to use the CPU to trigger the samplings then the samples might be delayed whenever a higher-priority task is currently executing on the CPU, such as in the case of BLE activity.&lt;br /&gt;In that case, your samples will not actually be taken when the timer timeout occurs, which could lead to the type of samples you are seeing.&lt;br /&gt;If you instead set up the SAADC sample TASK to trigger by the TIMER Capture/Compare EVENT, then the sampling will be triggered immediately once the Capture/compare event is generated, without CPU interaction.&lt;br /&gt;The CPU then only needs to wake up to process the SAADC buffer when it is full, but not for each sampling to take place.&lt;br /&gt;Using the PPI approach is required if you need high accuracy on the timing of the samples, such as when sampling a high frequency signal.&lt;br /&gt;&lt;br /&gt;You could&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/tree/master/ble_app_uart__saadc_timer_driven__scan_mode"&gt;take a look at this example&lt;/a&gt;&amp;nbsp;to see how you could set up the SAADC to trigger by a timer through PPI.&lt;br /&gt;&lt;br /&gt;Could you also clarify whether you are working with the nRF Connect SDK or the nRF5 SDK, and which version?&lt;br /&gt;Lastly, could you show the code of your SAADC initialization as well?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Recording 2channel analogue signal NRF52832</title><link>https://devzone.nordicsemi.com/thread/408102?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 23:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea013c0-abaa-4c7b-8904-0c835755c35d</guid><dc:creator>hyhaerong</dc:creator><description>&lt;p&gt;The code that I used as a reference is the &amp;#39;Heart rate measurement&amp;#39; example!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>