<?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>app_timer use with uart_cli</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67494/app_timer-use-with-uart_cli</link><description>I&amp;#39;m working on a cli_uart application on a PCA10040 board using SDK 17.0.0. I started out by using the SDK peripheral example for twi_master with twis_slave as a base for the work. Then I wanted to add a one second timer using app_timer to periodically</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Oct 2020 18:45:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67494/app_timer-use-with-uart_cli" /><item><title>RE: app_timer use with uart_cli</title><link>https://devzone.nordicsemi.com/thread/276504?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 18:45:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebc8767b-232f-475a-9a93-cce2f5f037b5</guid><dc:creator>maxx44</dc:creator><description>&lt;p&gt;Einar,&lt;/p&gt;
&lt;p&gt;I went through the Application Timer Tutorial again and carefully reviewed the settings I was using.&lt;/p&gt;
&lt;p&gt;It turns out I missed applying the APP_TIMER_TICKS macro to the interval in app_timer_start.&amp;nbsp; I had a define all set up for it too!&amp;nbsp; As a result I got some integer value in there that was probably a much shorter interval than I was expecting.&lt;/p&gt;
&lt;p&gt;Once I got that straightened out, app_timer for a 1 second interval (using APP_TIMER_TICKS(1000) in app_timer_start) works fine in the SDK example twi_master_with_twis_slave.&lt;/p&gt;
&lt;p&gt;Max&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_timer use with uart_cli</title><link>https://devzone.nordicsemi.com/thread/276479?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 14:30:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:561824fc-927e-4a92-ba02-8e646f8b1493</guid><dc:creator>maxx44</dc:creator><description>&lt;p&gt;Thanks Einar.&amp;nbsp; I see app_timer2.c is being used.&lt;/p&gt;
&lt;p&gt;In the meantime, I tried setting up a hardware nrfx_timer using a method outlined in this forum.&amp;nbsp; That seems to be working nicely but I have some more testing to do.&lt;/p&gt;
&lt;p&gt;Before sending a code sample, I think I&amp;#39;ll go back to a copy the original example and just add an app_timer to that to make sure I didn&amp;#39;t mess up with other things I was trying to implement.&amp;nbsp; That would be additional CLI commands and some GPIO with a PWM output.&amp;nbsp; I&amp;#39;ll let you know what that reveals.&lt;/p&gt;
&lt;p&gt;Max&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_timer use with uart_cli</title><link>https://devzone.nordicsemi.com/thread/276372?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 08:43:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae6967ea-736e-4856-9b47-6aa6458180f9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you using app_timer.c or app_timer2.c? The original app_timer implementation has a known bug where it can expire immediately in some cases with high timeout values. This (and other issues) should be fixed in app_timer2. Migrating to app_timer2 is covered in the last part of the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/migration.html"&gt;migration guide for SDK 16&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If this is not the issue then it would be interesting to see your code in order to understand what is happening.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>