<?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>HX711 with ANT bpwr profile</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55641/hx711-with-ant-bpwr-profile</link><description>Hi, 
 I am working with ANT bpwr tx profile and trying to implement HX711 and TWI sensor to it. TWI sensor is already working, but when I add library for HX711 from and start sampling HX711, the ant transmission looks like it stops transmitting, or lose</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Dec 2019 15:49:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55641/hx711-with-ant-bpwr-profile" /><item><title>RE: HX711 with ANT bpwr profile</title><link>https://devzone.nordicsemi.com/thread/225719?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2019 15:49:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:512fe0cd-2c0b-465a-a449-12617430c1cf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It shouldn&amp;#39;t be necessary to initialize it before the Softdevice. I think you will need to debug the app if you want to find out why it&amp;#39;s required in your case.&amp;nbsp;&lt;/p&gt;
[quote user="Pepam"]I have one last question. Please, could you provide me some link, where i can find and learn more about these lines of code about timer and its compare registers that you used in your library?[/quote]
&lt;p&gt;I used PPI, GPIOTE, and TIMER for this so I think you may find the following links helpful:&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;&lt;a title="GPIOTE" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/hardware_driver_gpiote.html?cp=6_1_2_0_3"&gt;GPIOTE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ppi.html?cp=4_2_0_21#concept_sxf_21l_1s"&gt;PPI — Programmable peripheral interconnect&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/timer.html?cp=4_2_0_23#concept_xbd_hqp_sr"&gt;TIMER — Timer/counter&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HX711 with ANT bpwr profile</title><link>https://devzone.nordicsemi.com/thread/225702?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2019 14:54:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21f7b95d-b158-4b8e-b9fa-b9d9c7ec86e2</guid><dc:creator>Pepam</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Solved it by moving hx711_init() and hx711_start() to the beginning of main function before code lines&amp;nbsp;that handles start of softdevice and profile initiation.&lt;/p&gt;
&lt;p&gt;And yes,&amp;nbsp;i am testing it on nRF52832 DK and when i wrote hx711_start(true) it didn`t work too. But now, when it is placed before softdevice and profile initiation it works.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have one last question. Please, could you provide me some link, where i can find and learn more about these lines of code about timer and its compare registers that you used in your library?&lt;/p&gt;
&lt;p&gt;Thanks for answer,&lt;/p&gt;
&lt;p&gt;Pepam&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/hx711_5F00_ant_2B00_.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void hx711_sample()
{
    NRF_TIMER2-&amp;gt;TASKS_CLEAR = 1;
    m_sample.count = 0;
    m_sample.value = 0;
    NRF_TIMER1-&amp;gt;TASKS_START = 1; // Starts clock signal on PD_SCK

    for (uint32_t i=0; i &amp;lt; ADC_RES; i++)
    {
        do
        {
            /* NRF_TIMER-&amp;gt;CC[1] contains number of clock cycles.*/
            NRF_TIMER2-&amp;gt;TASKS_CAPTURE[1] = 1;
            if (NRF_TIMER2-&amp;gt;CC[1] &amp;gt;= ADC_RES) goto EXIT; // Readout not in sync with PD_CLK. Abort and notify error.
        }
        while(NRF_TIMER1-&amp;gt;EVENTS_COMPARE[0] == 0);
        NRF_TIMER1-&amp;gt;EVENTS_COMPARE[0] = 0;
        m_sample.value |= (nrf_gpio_pin_read(DOUT) &amp;lt;&amp;lt; (23 - i));
        m_sample.count++;
    }
    EXIT:

    if (!m_continous_sampling)
    {
        NRF_GPIOTE-&amp;gt;TASKS_SET[1] = 1; // HX711 power-down
    }
    
    
    /*and also this part of Your code==========================================*/
      
      NRF_TIMER1-&amp;gt;CC[0]     = 1;
  NRF_TIMER1-&amp;gt;CC[1]     = TIMER_COMPARE;
  NRF_TIMER1-&amp;gt;CC[2]     = TIMER_COUNTERTOP;
  NRF_TIMER1-&amp;gt;SHORTS    = (uint32_t) (1 &amp;lt;&amp;lt; 2);    //COMPARE2_CLEAR
  NRF_TIMER1-&amp;gt;PRESCALER = 0;

  NRF_TIMER2-&amp;gt;CC[0]     = m_mode;
  NRF_TIMER2-&amp;gt;MODE      = 2;

  NRF_GPIOTE-&amp;gt;CONFIG[1] = (uint32_t) (3 | (PD_SCK &amp;lt;&amp;lt; 8) | (1 &amp;lt;&amp;lt; 16) | (1 &amp;lt;&amp;lt; 20));

  NRF_PPI-&amp;gt;CH[0].EEP   = (uint32_t) &amp;amp;NRF_TIMER1-&amp;gt;EVENTS_COMPARE[0];
  NRF_PPI-&amp;gt;CH[0].TEP   = (uint32_t) &amp;amp;NRF_GPIOTE-&amp;gt;TASKS_SET[1];
  NRF_PPI-&amp;gt;CH[1].EEP   = (uint32_t) &amp;amp;NRF_TIMER1-&amp;gt;EVENTS_COMPARE[1];
  NRF_PPI-&amp;gt;CH[1].TEP   = (uint32_t) &amp;amp;NRF_GPIOTE-&amp;gt;TASKS_CLR[1];
  NRF_PPI-&amp;gt;FORK[1].TEP = (uint32_t) &amp;amp;NRF_TIMER2-&amp;gt;TASKS_COUNT; // Increment on falling edge
  NRF_PPI-&amp;gt;CH[2].EEP   = (uint32_t) &amp;amp;NRF_TIMER2-&amp;gt;EVENTS_COMPARE[0];
  NRF_PPI-&amp;gt;CH[2].TEP   = (uint32_t) &amp;amp;NRF_TIMER1-&amp;gt;TASKS_SHUTDOWN;
  NRF_PPI-&amp;gt;CHEN = 7;
}
    &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HX711 with ANT bpwr profile</title><link>https://devzone.nordicsemi.com/thread/225671?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2019 13:52:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8732f3b1-b64f-4594-a83a-3fbd0d3dc201</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you testing this on a Nordic DK? I&amp;#39;m wondering if maybe the continuous sampling interferes with the radio.&amp;nbsp;Please try and see if it works if you only call&amp;nbsp;hx711_start&lt;strong&gt;(true)&amp;nbsp;&lt;/strong&gt;once.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>