<?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>Counter does not count correctly external signal</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19192/counter-does-not-count-correctly-external-signal</link><description>Hello,
I&amp;#39;m having special SPI protocol which requires SPI Slave to toggle REDAY pin after every byte. I do test using 2 nRF52 boards. One is SPI master, another is slave. When I do it in SW then it works fine for multiple hours. There is a loop that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Jan 2017 12:39:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19192/counter-does-not-count-correctly-external-signal" /><item><title>RE: Counter does not count correctly external signal</title><link>https://devzone.nordicsemi.com/thread/74335?ContentTypeID=1</link><pubDate>Thu, 26 Jan 2017 12:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:661acd32-45a7-4954-9757-5fdb97aafb4a</guid><dc:creator>vit bernatik</dc:creator><description>&lt;p&gt;Yes the screenshot is exactly when it failed. The green line is RDY which shall toggle every 8 falling edges. As you can see on the screenshot it toggled after 7 pulses.
I&amp;#39;m not using ribbon cable, but separate cables. Anyway it seems not being problem for SPI module itself only for counter module. Also as I said last time I&amp;#39;m using 1MHz not 8Mhz.
I have assumption that when you let counter count then you will end up with more edges than you generate. But true it would be easier reproduce when I could share the source code. Unfortunately I can not. But I did share on private forum. I keep this thread so others can benefit from findings.
I could test a filter if there is no better proposal. But I have fear that filter would decrease slope of the edges and could result in making issue even worse.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Counter does not count correctly external signal</title><link>https://devzone.nordicsemi.com/thread/74332?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2017 19:51:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d130bd41-befa-45b1-812d-e9f2ee295359</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;I cant see any noise on the signal from your pictures. But did it fail with the scope attached ?&lt;/p&gt;
&lt;p&gt;Btw. IMHO even 15 cm is a long signal path at 8mhz. Do you use a ribbon cable, as crosstalk can be a problem.&lt;/p&gt;
&lt;p&gt;I am not sure how you expect anyone to reproduce your problem as you have not shared your full source code or hardware designs.&lt;/p&gt;
&lt;p&gt;I recommend you contact Nordic for private support via their other portal, as this is a community forum and most of the people who answer questions ( me included) do not work for Nordic.&lt;/p&gt;
&lt;p&gt;Btw.
A filter may only require one resistor and one capacitor, which would require very little space on your board, but it sounds like you dont have any analog design experience&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Counter does not count correctly external signal</title><link>https://devzone.nordicsemi.com/thread/74334?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2017 10:31:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acbd6c02-4b5b-4c03-9a84-8ea1f1c81249</guid><dc:creator>vit bernatik</dc:creator><description>&lt;p&gt;We need very low power consumption - therefore we use as much sleep as possible. So SW implementation is problematic. I already have a SW design which works, but I tried to optimize with COUNTER+PPI.&lt;/p&gt;
&lt;p&gt;Can you reproduce the problem at your side? (note it requires more seconds to run to manifest the problem)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Counter does not count correctly external signal</title><link>https://devzone.nordicsemi.com/thread/74333?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2017 10:31:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e256cc4e-456d-49f4-97c0-f6a950425d28</guid><dc:creator>vit bernatik</dc:creator><description>&lt;p&gt;I tired to use it also with other pin externally connected for Counter and it did not helped. BTW can you please point me where in documentation you recommend not to use same pin for more modules?
I use NRF_SPIS0. Is there difference between SPIS modules?
To me it seems that counter is miscounted rather than PPI would be mis-triggered (that I assume is consequence, not cause)
My SPI_CLK is not 8MHz but 1MHz and no I can not go lower - system spec.
The problem occurs also when logic analyser is not attached.
Original wire was 55cm but problem stays if I use shorter wire 15cm.
We are designing watch - it is problem for us to use external filter components - due to space. ARM chips often have internal debouncer if required for their counter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Counter does not count correctly external signal</title><link>https://devzone.nordicsemi.com/thread/74331?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2017 02:00:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e86c093-15f2-4c9a-b8fb-ee34b4ce7193</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;What SPI Slave are you using ?&lt;/p&gt;
&lt;p&gt;Sounds like the PPI is being miss-triggered.&lt;/p&gt;
&lt;p&gt;Ole&amp;#39;s answer sounds interesting, as I suspect you are not doing something that the hardware designers considered when they designed the PPI.&lt;/p&gt;
&lt;p&gt;As far as I can tell, you are running this the SPI at 8Mhz, did you try running it slower?&lt;/p&gt;
&lt;p&gt;Also. Does this problem occur if the logic analyser is not attached?&lt;/p&gt;
&lt;p&gt;Or is this peripheral on long wires etc.&lt;/p&gt;
&lt;p&gt;You may be able to resolve the problem by adding a filter that remove any high frequency noise from the clock line.&lt;/p&gt;
&lt;p&gt;Or as a last resort, you may need to write your own software &amp;quot;bit-banged&amp;quot; SPI in order to be able to use this device, or perhaps use an external divider IC to divide the clock by 8 in order to produce the toggling RDY signal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Counter does not count correctly external signal</title><link>https://devzone.nordicsemi.com/thread/74330?ContentTypeID=1</link><pubDate>Tue, 24 Jan 2017 10:42:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f25a060a-1034-4baa-9c86-3abf6b034adf</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;So GPIOTE IN event is configured for the same pin that is used SPI CLK? We normally do not recommend to use multiple peripherals on the same pin. Can you try to assign them to two different pins, connect them externally instead and see if the problem is still there?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>