<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>Capture Qei position and send to usb</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/40036/capture-qei-position-and-send-to-usb</link><description> 
Hi 
I want to draw graphs of position of 2-phased QEI versus time. so I
want to capture QEI position every time period. time gap between to
position pulses is at least 7.2 microseconds. 
I think I have to choose one of these methods: 

 
 1-send position</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/156800?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 10:11:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:05a92c8b-c007-4983-b50d-cbe37d08590d</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
You helped me a lot Dear Mr Westermark.&lt;br /&gt;
I&amp;#39;ll have more &amp;amp; more questions after the test.&lt;/p&gt;

&lt;p&gt;
Thanks alot&lt;br /&gt;
Amir&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/156645?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 10:02:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:52a56691-349d-459d-8dfd-941a07e4da66</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
My emphasis _your_ is because people on this forum can&amp;#39;t explain
code you still haven&amp;#39;t written. You must first write it and then post
it before anyone can come back with feedback.&lt;/p&gt;

&lt;p&gt;
Next thing. You don&amp;#39;t collect 512 byte of data. Then ask the USB
layer to send your data. Then reset your counter and start to collect
more data. You need to continue to collect data while you wait for
the USB transfer. That is why you need to have two buffers - or a
twice as large buffer - so you can capture more data concurrently
with the USB transmission.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/156494?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 09:15:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:03d46106-92dd-47d0-b48a-49a883ef4416</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt;&lt;i&gt;Since you have an interrupt that produces one value at a
time, it would be _your_ code that inserts data into the buffer. So
it should be easy for _your_ code to know when you have 512 bytes of
data.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I don&amp;#39;t know reason of _your_ emphasis on _your_.&lt;br /&gt;
Any way, when the number of bytes send to the buffer equals to 512,
_My_ codes should sets an interrupt. and then it sends the buffer to
USB. and then the counter for buffer should reset. I don&amp;#39;t care that
some counts at this short time lost.&lt;/p&gt;

&lt;p&gt;
but I have some problem with it that ask you after further
works.&lt;/p&gt;

&lt;p&gt;
Amir&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/156311?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 08:35:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7fbec210-cce8-432a-8daa-5824222d84c7</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Since you have an interrupt that produces one value at a time, it
would be _your_ code that inserts data into the buffer. So it should
be easy for _your_ code to know when you have 512 bytes of data.&lt;/p&gt;

&lt;p&gt;
Interrupt latency? Are you sure you need to worry about any
interrupt latency? Exactly what latency are you worrying about? As
long as the interrupt reads out data before a new sample is
available, you should not have to worry so much about latency.&lt;/p&gt;

&lt;p&gt;
Next thing: If the quadrature encoder is limited to serving one
value/interrupt, then that is a limitation you have to live with. The
user manual for the quadrature encoder tells exactly what it can
do.&lt;/p&gt;

&lt;p&gt;
How to buffer data? Like you would buffer any other data. The
processor don&amp;#39;t care much about the reason why you put data in a
buffer. And the USB layer don&amp;#39;t care much about what data you have in
a buffer when you tell it to send a block of data.&lt;/p&gt;

&lt;p&gt;
In the end - if you copy an example: Make sure you read through
that example enough that you understand what you did copy. That
source code would tell you what WriteBuffer points to. And how to
access that buffer - or if it is even applicable to make use of that
buffer or if you should instead create your own buffer. But the USB
layer still don&amp;#39;t care much about what specific code did insert data
into a buffer. It cares about the transfer requests you specify.&lt;/p&gt;

&lt;p&gt;
If you modify code, then it will be up to you to figure out if a
buffer suddenly becomes unused. Or if an existing buffer can suddenly
get a new use because your data collection is just comming from some
other source.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/156086?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 07:39:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c32ba4b8-a2d0-4c08-a199-beaca77310a3</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt;&lt;i&gt;&amp;quot;i&amp;#39;ll working on it.&amp;quot; is different with &amp;quot;i&amp;#39;m working on
it....&amp;quot;&lt;/i&gt;&lt;br /&gt;
OK thanks for the grammatical point.&lt;/p&gt;

&lt;p&gt;
But if you had read the first post:&lt;br /&gt;
&amp;gt;&lt;i&gt;can i send data to buffer and send batch buffer to USB? Is it
help me Reduce interrupt latancy effects?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
and in the 4th post:&lt;br /&gt;
&amp;gt;&lt;i&gt;and USBhostlite code is available here: ...and I removed Uart
from codes so that it just copies data to usb.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
You would have found that I know what the buffer is. but I don&amp;#39;t
know how to configure it.&lt;br /&gt;
UserBuffer is the name used in USBhostlite(Main_Copy). and I choosed
it. but I asked several times that:&lt;/p&gt;

&lt;pre&gt;
due to low rate of USB functions, i must buffer data and send them in batch. And in the end, i should reset the timer.
so how can i buffer the data? should i use an auxiliary register?
how can i detect that number of bytes written in QEITIME(or auxilary Buffer) is 512?
&lt;/pre&gt;

&lt;p&gt;
Amir&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/155846?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 06:54:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9e34c9a4-8cf5-4a81-97b7-136229a94be3</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;quot;i&amp;#39;ll working on it.&amp;quot; is different with &amp;quot;i&amp;#39;m working on it&amp;quot;&lt;/p&gt;

&lt;p&gt;
Correct - &amp;quot;I&amp;#39;ll working&amp;quot; isn&amp;#39;t a correct sentence.&lt;br /&gt;
&amp;quot;I am working&amp;quot; - doing now.&lt;br /&gt;
&amp;quot;I have been working&amp;quot; - have already done it&lt;br /&gt;
&amp;quot;I will be working&amp;quot; - something happening in the future&lt;br /&gt;
&amp;quot;I will work&amp;quot; - something happening in the future&lt;br /&gt;
&amp;quot;I am going to be working&amp;quot; - basically just more complicated
construct&lt;/p&gt;

&lt;p&gt;
But that still doesn&amp;#39;t change the fact that you - after having
received all required information - comes back after a number of days
and tells us how disappointed you are that no one is giving you the
required answers. And then, when asked about your email address,
specifically say you put up the address to let people quote a price
to supply you with the information no one can really give you since
you first need to write that ISR before it will be known what name
you selected for that buffer.&lt;/p&gt;

&lt;p&gt;
That implies that you haven&amp;#39;t been working on the problem, but
have instead been assuming someone else should supply you with a
solution. Enough so, that you are getting a bit irritated that people
haven&amp;#39;t stepped in and posted the solution.&lt;/p&gt;

&lt;p&gt;
The traditional route is that people work first. Then post
questions about specific issues when they are stuck. Such a route
would have made it obvious to you that you didn&amp;#39;t have any open
question about any buffer name more than a week ago.&lt;/p&gt;

&lt;p&gt;
Not only that. You earlier did write &amp;quot;I have written below codes
[...]&amp;quot; and posted code containing:&lt;/p&gt;

&lt;pre&gt;
*UserBuffer=LPC_QEI-&amp;gt;QEITIME;
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
So it would then be up to you to know exactly where that &amp;quot;UserBuffer&amp;quot;
comes from.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/155567?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 06:14:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:39077cb3-c3b5-45fb-9029-90434c437fd6</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;quot;&lt;b&gt;i&amp;#39;ll&lt;/b&gt; working on it.&amp;quot; is different with &amp;quot;&lt;b&gt;i&amp;#39;m&lt;/b&gt; working
on it&amp;quot;&lt;/p&gt;

&lt;p&gt;
Because I am working on some thing in Parallel. and as I said
before, due to my weak Architecture knowledge, I had no imagination
about DMA.&lt;br /&gt;
If you did not tell me that DMA must supports the QEI, I would keep
on concentrating on it. Because I thought that I can consider the
&lt;b&gt;QEITIME&lt;/b&gt; register as a part of Memory, and use
&amp;quot;Memory-to-memory transfer&amp;quot; feature to buffer Data. but as _you_
said, it is not suitable to use DMA. and I think I should use a
vector as buffer.&lt;/p&gt;

&lt;p&gt;
thanks&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/155844?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 05:30:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:be09f065-4ecd-4db8-99d0-44a969b71e05</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Yes - you need to take care of the results one-by-one in an ISR.
And invent a buffer to store the result in.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/155233?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 05:29:10 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b24c0c2b-466a-4343-a9a8-1cbdf9796086</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Are you sure you are working on this?&lt;/p&gt;

&lt;p&gt;
I did a very quick browse of the GPDMA information in the
processor user manual - it doesn&amp;#39;t list the quadrature encoder among
supported sources.&lt;/p&gt;

&lt;p&gt;
Which means you basically got all required information already in
Tsuneo&amp;#39;s earlier posts, if you had decided to read what he wrote and
compare with the capabilities of your processor.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/155569?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 05:26:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f85f62bb-0acd-4df5-be57-1cfcb9dafd63</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
OK&lt;br /&gt;
the datasheet says:&lt;/p&gt;

&lt;pre&gt;
GPDMA supports the SSP, I2S, UART, A/D Converter, and D/A Converter peripherals.
DMA can also be triggered by a timer match condition. Memory-to-memory transfers
and transfers to or from GPIO are also supported.
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
and it appears that DMA doesn&amp;#39;t support QEI.&lt;br /&gt;
so I must define a normal vector as a buffer, am I right?&lt;br /&gt;
and due to the low rate of data changes(least than 1 MHz) the ISR
should &amp;quot;pick up a single value and put in a buffer.&amp;quot;&lt;/p&gt;

&lt;p&gt;
I am a beginner in ARM and embedded systems, and need to learn too
much about architecture. ;-)&lt;/p&gt;

&lt;p&gt;
thanks&lt;br /&gt;
Amir&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/155232?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 04:31:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:369f1c7e-308f-458b-a1f1-ec3c18d5f4e2</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
When using any peripherial that has the hardware support for it,
you may be able to poll the device for data. Or configure the device
to issue an interrupt for each data getting available. Or configure
the device to hand off data to a DMA channel. This may be an SPI
device, an UART, or maybe an ADC - the concept is still the same.&lt;/p&gt;

&lt;p&gt;
So if this quadrature device supports DMA, then you need to
configure one DMA channel to take the quadrature device as data
source, and a buffer as data destination. The DMA channel can then
generate interrupts to let you take care of received data and
potentially supply new buffers to use. For DMA channels that supports
it, it is often nice to have a buffer that is twice as large as the
block size you want. So the DMA channel can interrupt when the buffer
is half-full. Then you have ample time to take care of the already
received data while the DMA channel continues to fill the other half
of the buffer. And the ISR can tell the DMA what to do when the
second half of the buffer gets full - i.e. that the DMA channel
should restart from the beginning of the buffer again. So you
basically double-buffer the transfer with a 2*n-sized buffer.&lt;/p&gt;

&lt;p&gt;
If you don&amp;#39;t have too high data rates, it is possible to ignore
any DMA transfers and instead have one interrupt/sample. And have the
ISR pick up a single value and put in a buffer. This is ok as long as
the ISR doesn&amp;#39;t consume too much time, and the ISR is guaranteed to
pick up a value before the device have produced the next value.&lt;/p&gt;

&lt;p&gt;
So Tsuneo Chinzei is talking about a concept, while leaving it to
you to flesh out actual code to fulfill this concept. Note also that
he wrote:&lt;/p&gt;

&lt;pre&gt;
As of QEI unit of LPC17xx, an ENCLK_Int interrupt occurs at the every transition of the
encoder. In this ISR, your firmware reads out a timer value, which runs freely, to know the
interval of the every transition. Cortex-M3 NVIC has fixed interrupt latency of 12 cycle. You
may get exact interval with this method.
&lt;/pre&gt;

&lt;p&gt;
That indicates the he isn&amp;#39;t talking about any DMA transfers, but
about the ISR handling individual samples. So that would obviously
mean that _you_ would be the one who decides the name of the buffer,
and you who decides how to keep track of amount of data in the
buffer.&lt;/p&gt;

&lt;p&gt;
So no way at all that anyone else can tell you the names that
_you_ would decide to use when _you_ implement that ISR. So the
reason no one gives you the answer to your questions is that it isn&amp;#39;t
possible for anyone to answer them. It&amp;#39;s on your table to decide.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/154822?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 02:55:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bbe23458-87d1-4a13-a1a0-5a2d175d5bac</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks&lt;br /&gt;
So, I must read the GPDMA session from datasheet. and define a
buffer.&lt;br /&gt;
i&amp;#39;ll working on it. and then ask the questions about it.&lt;/p&gt;

&lt;p&gt;
Best Regards&lt;br /&gt;
Amir&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/154316?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 02:18:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9d230e21-1eb4-4f7b-8af7-00f3993bf7eb</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;quot;about one of my questions &amp;quot;the helper already know the
answer.&amp;quot;&amp;quot;&lt;/p&gt;

&lt;p&gt;
Sorry, but you need to read more carefully.&lt;/p&gt;

&lt;p&gt;
The text you mention said:&lt;/p&gt;

&lt;pre&gt;
In the QEI ISR, the timer value is written to a buffer of 1024 bytes.
When the buffer holds 512 bytes (sector size) or more, one sector of data is written to the USB
drive.
&lt;/pre&gt;

&lt;p&gt;
If you write a QEI ISR, then it would be _you_ who knows the name
of the buffer _you_ place the values in. And it would be _you_ who
knows when you have 512 bytes of data in that buffer, so _you_ would
know when you have enough to write one sector to the USB drive.&lt;/p&gt;

&lt;p&gt;
If _you_ haven&amp;#39;t written the QEI ISR, then it would still be _you_
who should locate the source of that ISR and look what buffer the
data is stored in.&lt;/p&gt;

&lt;p&gt;
Do you even know if there exists any QEI ISR?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/153741?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2013 01:57:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:65b79bb0-d4eb-47bd-90cd-f609dfd8e9f4</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt;&lt;i&gt;In the QEI ISR, the timer value is written to a buffer of
1024 bytes.[Tsuneo]&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;When the buffer holds 512 bytes (sector size) or more, one
sector of data is written to the USB drive.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
about one of my questions &amp;quot;the helper already know the answer.&amp;quot;
and i want to know whats the name of the buffer. is it direct or
indirrect? but no body answered me.&lt;/p&gt;

&lt;p&gt;
I said if they don&amp;#39;t want to &amp;quot;share their information&amp;quot; for free
and want to &amp;quot;earn &amp;#36;&amp;#36;&amp;#36;&amp;quot;, I respectfully write my Email, to send me the
price, Because I really need this buffer.&lt;/p&gt;

&lt;p&gt;
Amir&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/153046?ContentTypeID=1</link><pubDate>Sun, 03 Feb 2013 18:03:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a2036e01-7a10-43d0-ba41-f4cc21f2dba2</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
What amusement do you find in the sentence &amp;quot;Maybe you would care
to expand why you feel &amp;#39;really disappointed&amp;#39;&amp;quot;?&lt;/p&gt;

&lt;p&gt;
Did you _really_ read what I wrote?&lt;/p&gt;

&lt;p&gt;
&amp;quot;Some people usually share their information &amp;amp; knowledge
through forum and some other ask (or even beg) other people to help
them.&amp;quot;&lt;/p&gt;

&lt;p&gt;
Share information requires that the helper already know the
answer. If no one who reads your question knows the answer, then no
one will be able to share that answer too, unless they invest own
time to figure out the answer. And here is where you _do_ have to
care about people just being other users of the Keil tools like your
self, or if this is a payed support service where people are payed to
supply help.&lt;/p&gt;

&lt;p&gt;
By the way - all your posting of email addresses implies that you
want answers sent directly to you instead of having the answers
posted on this forum. Private answers do have the big disadvantage
that they can&amp;#39;t be picked up by Google. So they would not help anyone
else.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/152301?ContentTypeID=1</link><pubDate>Sun, 03 Feb 2013 15:06:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9a44a757-4ebc-45bc-8d81-56561d6d6895</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt;&lt;i&gt;Aren&amp;#39;t you a funny guy?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&amp;gt;&lt;i&gt;Maybe you would care to expand why you feel &amp;quot;really
disappointed&amp;quot;.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I don&amp;#39;t care you are an active user or a KEIL Employee. but is it
your &lt;b&gt;amusement&lt;/b&gt; to visit this forum to write such
sentences?&lt;/p&gt;

&lt;p&gt;
Some people usually share their information &amp;amp; knowledge
through forum and some other ask (or even beg) other people to help
them.&lt;br /&gt;
I didn&amp;#39;t forced Mr Tsuneo &amp;amp; Mr Erik to answer me! Both of them
kindly answered some of my questions. And speaking about
&amp;quot;disappointing&amp;quot; won&amp;#39;t oblige them to answer and I think it does not
contain any insults.&lt;/p&gt;

&lt;p&gt;
Amir&lt;br /&gt;
Hejazi.1365@gmail.com&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/151510?ContentTypeID=1</link><pubDate>Sun, 03 Feb 2013 09:32:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:544bf3cf-9050-4cbe-8bc8-cefbdd4f2d9d</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Maybe you would care to expand why you feel &amp;quot;really
disappointed&amp;quot;.&lt;/p&gt;

&lt;p&gt;
It isn&amp;#39;t like you are paying to get support from this web
forum.&lt;/p&gt;

&lt;p&gt;
The only way other Keil users can help you is by spending their
time retrieving the available information and read it. The big
question is why other people should invest their own, private, time
to do that when they don&amp;#39;t have any incentive to do so. That time
could instead be spent listening to music, walking the dog or maybe
earn &amp;#36;&amp;#36;&amp;#36; by developing applications.&lt;/p&gt;

&lt;p&gt;
You, on the other hand, should have specific incentives to spend
time with the available sample source code, application notes and
processor user manual.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/146973?ContentTypeID=1</link><pubDate>Sat, 02 Feb 2013 19:21:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2c278123-10e0-4762-95fa-673baf61d36e</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;I got really disappointed!!&lt;br /&gt;
Any body couldn&amp;#39;t help me with the buffer?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
not trying to &amp;#39;disappoint&amp;#39; you but I can&amp;#39;t simply because I have
never worked with this specific issue (have no idea what QEITIME
is)&lt;br /&gt;
&lt;i&gt;how can i detect that number of bytes written in QEITIME(or
auxilary Buffer) is 512?&lt;/i&gt;&lt;br /&gt;
for the usual buffer which is written by address[index] &amp;#39;index&amp;#39;, of
course will hol;d the count.&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/145456?ContentTypeID=1</link><pubDate>Sat, 02 Feb 2013 16:04:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:022f3fac-137b-4493-8d6c-baaaf98dcec0</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
I got really disappointed!!&lt;br /&gt;
Any body couldn&amp;#39;t help me with the buffer?&lt;/p&gt;

&lt;p&gt;
thanks&lt;br /&gt;
Amir&lt;br /&gt;
hejazi1365[at]gmail[dot]com&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/143338?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2013 05:23:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:83dc3fde-6e3f-466b-ac9e-e8284287563a</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;b&gt;Hi Dear Erik&lt;/b&gt;&lt;br /&gt;
It seems that Tsuneo rarely comes here!&lt;br /&gt;
due to low rate of USB functions, i must buffer data and send them in
batch. And in the end, i should reset the timer.&lt;br /&gt;
so how can i buffer the data? should i use an auxiliary register?&lt;br /&gt;
how can i detect that number of bytes written in QEITIME(or auxilary
Buffer) is 512?&lt;br /&gt;
should i pend the interrupt to send the data(buffer) to USB? cause
the usb functions are too slow?&lt;/p&gt;

&lt;p&gt;
Amir&lt;br /&gt;
hejazi1365[at]gmail[dot]com&lt;br /&gt;
Best regards&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/147861?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2013 18:45:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:55d019f0-7ad7-4083-a8c6-efcfc82d30e4</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
I still haven&amp;#39;t got answered my previous questions!&lt;br /&gt;
I don&amp;#39;t know how to get access to the buffer that included
timer(QEITIME) values?&lt;/p&gt;

&lt;p&gt;
another question:&lt;br /&gt;
what is the practical difference between &lt;b&gt;set register&lt;/b&gt; &amp;amp;
&lt;b&gt;enable register&lt;/b&gt;(QEISET &amp;amp; QEIIES)? Can you give me an
example please?&lt;/p&gt;

&lt;p&gt;
Amir&lt;br /&gt;
&lt;i&gt;hejazi1365[at]gmail[dot]com&lt;/i&gt;&lt;br /&gt;
Best regards&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/146970?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2013 07:16:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5eefed2e-2b47-48f2-bcb8-6ec9c023c6cd</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt;&lt;i&gt;When the buffer &lt;b&gt;holds 512 bytes (sector size)&lt;/b&gt; or
more, one sector of data is written to the USB drive.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Thanks Dr Tsuneo Chinzei&lt;/p&gt;

&lt;p&gt;
But how can i detect that number of bytes written in QEITIME is
512?&lt;br /&gt;
And how to Empty the buffer after writing data?&lt;/p&gt;

&lt;p&gt;
An other Question: Is it correct to write &lt;b&gt;LPC_QEI-&amp;gt;FILTER
=0xc8; /*200*/&lt;/b&gt; to filter less than 2us when clock is 100mhz?&lt;/p&gt;

&lt;p&gt;
Best Regards?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/146971?ContentTypeID=1</link><pubDate>Sat, 19 Jan 2013 15:36:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c95b4223-4d31-4788-9f6c-fbb409d25c7d</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt;&lt;i&gt;The time constant of the passive input RC (LC) filter is
determined by the PCLK frequency of QEI.&lt;br /&gt;
It&amp;#39;s much less than (1/8 - 1/16) of PCLK&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
So, if i want to filter pulses less than 2us, what should i
write?(clk=100mhz)&lt;br /&gt;
LPC_QEI-&amp;gt;FILTER =0xc8; /*200*/&lt;br /&gt;
Is it correct?&lt;/p&gt;

&lt;p&gt;
&amp;gt;&lt;i&gt;When the buffer holds 512 bytes (sector size) or more, one
sector of data is written to the USB drive.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Oh, I am a beginner!&lt;br /&gt;
I don&amp;#39;t know how to access to the buffer. How can i get access to
this Buffer?&lt;br /&gt;
what should i write instead of
&lt;b&gt;*UserBuffer=LPC_QEI-&amp;gt;QEITIME;&lt;/b&gt; ??&lt;br /&gt;
can you help me with the codes?&lt;br /&gt;
thanks&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/145465?ContentTypeID=1</link><pubDate>Sat, 19 Jan 2013 11:47:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:88af2264-a324-446f-9b10-d50303795d04</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;gt; LPC_QEI-&amp;gt;FILTER =???(What should i put??&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;The time constant of the passive input RC (LC) filter is
determined by the PCLK frequency of QEI.&lt;br /&gt;
It&amp;#39;s much less than (1/8 - 1/16) of PCLK&lt;br /&gt;
QEI FILTER register holds a minimum expected interval of encoder
transition, counted in PCLK scale.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt; Is it correct set priority of USB to 0 and QEI to
1??&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
QEI should have the highest priority (0), and USB is assigned to
lower priority than QEI.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt; I have written below codes to send the data to usb using
usbhost lite.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
FILE_Open, FILE_Write and FILE_Close are too slow to run in the
QEI ISR.&lt;br /&gt;
Also, it is efficient to write data of sector size at a time.&lt;/p&gt;

&lt;p&gt;
In the QEI ISR, the timer value is written to a buffer of 1024
bytes.&lt;br /&gt;
When the buffer holds 512 bytes (sector size) or more, one sector of
data is written to the USB drive.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Capture Qei position and send to usb</title><link>https://community.arm.com/thread/143341?ContentTypeID=1</link><pubDate>Thu, 17 Jan 2013 17:57:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f4cc7f0f-8776-4b7a-a7af-2272825cff4d</guid><dc:creator>Amir Hejazi</dc:creator><description>&lt;p&gt;&lt;p&gt;
thanks:&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;Such a noise is filtered by,&lt;br /&gt;
1) R/C (or L/C) filter at the input pins of the QEI unit.&lt;br /&gt;
And&lt;br /&gt;
2) The integrated digital filter of the LPC17xx QEI unit.&lt;/i&gt;&lt;br /&gt;
Is it embedded in the IC or Should I do ?&lt;br /&gt;
LPC_QEI-&amp;gt;FILTER =???(What should i put??)&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;As of QEI unit of LPC17xx, an ENCLK_Int interrupt occurs at the
every transition of the encoder....&lt;/i&gt;&lt;br /&gt;
I have written below codes to send the data to usb using usbhost
lite.&lt;br /&gt;
FILE_Open, FILE_Write &amp;amp; FILE_Close belong to USBHostlite
part:&lt;/p&gt;

&lt;pre&gt;
void qei_main(){
&lt;b&gt;        //Basic Configuration:&lt;/b&gt;
        LPC_SC-&amp;gt;PCONP |= (1&amp;lt;&amp;lt;18);
        LPC_SC-&amp;gt;PCLKSEL1  |= (0x01);
        &lt;b&gt;//configuration for the pins:&lt;/b&gt;
        LPC_PINCON-&amp;gt;PINSEL3 |=((1&amp;lt;&amp;lt;8)|(1&amp;lt;&amp;lt;14)|(1&amp;lt;&amp;lt;16));&lt;b&gt;//PH A&amp;amp;B &amp;amp; index&lt;/b&gt;
        LPC_QEI-&amp;gt;QEICONF =(1&amp;lt;&amp;lt;2);&lt;b&gt;//PhA and PhB function as quadrature encoder inputs.(4x)&lt;/b&gt;
        LPC_QEI-&amp;gt;QEICON = 0x02;&lt;b&gt;//Control register: Reset position counter on index.(RESPI)&lt;/b&gt;
        LPC_QEI-&amp;gt;INXCMP = 0x00;&lt;b&gt;//QEI Index Compare register                                                                                                       &lt;/b&gt;    LPC_QEI-&amp;gt;QEILOAD = 0x00;&lt;b&gt;//QEI Timer Reload register&lt;/b&gt;
        LPC_QEI-&amp;gt;QEICLR = 0xFFFFFFFF;
        LPC_QEI-&amp;gt;QEIIEC = 0xFFFFFFFF;
        LPC_QEI-&amp;gt;QEIIES = 0x00000020;&lt;b&gt;//enable ENCLK_EN&lt;/b&gt;
}
NVIC_EnableIRQ(QEI_IRQn);               &lt;b&gt;/*enable the interrupt*/&lt;/b&gt;
NVIC_SetPriority (USB_IRQn, 1);         &lt;b&gt;/*2nd priority--is it correct??*/&lt;/b&gt;

void QEI_IRQHandler(void){
        USB_INT32S  fdw;
        fdw = FILE_Open(FILENAME_W, RDWR);
        if (fdw&amp;gt;0) {
                *UserBuffer=LPC_QEI-&amp;gt;QEITIME;
                FILE_Write(fdw,UserBuffer,4);
                FILE_Close(fdw);
        }else{
                return;
        }
        LPC_QEI-&amp;gt;QEICLR = 0xFFFFFFFF;  &lt;b&gt; // clear all interrupts&lt;/b&gt;
}
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
Is it correct set priority of USB to 0 and QEI to 1??&lt;/p&gt;

&lt;p&gt;
kind regards&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>