<?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>Coprocessor</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/33246/coprocessor</link><description> Hello All! 
 
Where can I find a complete example of using C167 coprocessor, including its initialization and (espesially desired) chasing when results of calculation are ready for reading? There are some details obscure for me. 
 
Thanks. </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/141224?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2003 06:16:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c0772511-ec88-460f-9fdb-12291e163f1a</guid><dc:creator>Graham Cole</dc:creator><description>&lt;p&gt;Before you go adding extra hardware to your system, you might consider alternative software algorithms. As has already been said, a microcontroller is not generally up to the job of doing lots of transendental functions.&lt;br /&gt;
&lt;br /&gt;
Ask yourself just how accurate you need these function to be. Then consider alternatives such as look-up tables.&lt;br /&gt;
&lt;br /&gt;
You might consider using series other that the Taylor series, such as the Pade Approximation (see &lt;a href="http://users.pandora.be/martin.brown/home/consult/logx.htm" target="_blank"&gt;http://users.pandora.be/martin.brown/home/consult/logx.htm&lt;/a&gt; ). Google for more.&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/141235?ContentTypeID=1</link><pubDate>Fri, 21 Mar 2003 02:32:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:252e2e5a-c513-4f6e-971a-c5a672c4e041</guid><dc:creator>Alexey Gradovtsev</dc:creator><description>&lt;p&gt;Mike,&lt;br /&gt;
&lt;br /&gt;
Hm... Yes, I admit my guilt. I didn&amp;#39;t say I use Cascod&amp;#39;s MF167 controller. I just thought that it&amp;#39;s a common approach to hardwire a coprocessor to 16x controllers and that they have common interface.&lt;br /&gt;
&lt;br /&gt;
Thanks a lot!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/137658?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 09:18:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:daa6243b-6a2f-42d4-8449-3a3e303d7910</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;&lt;i&gt;Of course there IS a single-instruction Sin function in MF167&amp;#39;s mathematical coprocessor&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Are you talking about the MAC unit?  If so, what device has a SIN MAC instruction?  Can you provide a link to the datasheet where this MAC instruction is described?&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/137660?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 09:13:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0ea11073-4085-434d-99c9-a8e90210f735</guid><dc:creator>Mik Kleshov</dc:creator><description>&lt;p&gt;Sorry Alexey,&lt;br /&gt;
This is clearly a case of misunderstanding. I can see that you mean this controller board:&lt;br /&gt;
&lt;a href="http://www.kaskod.ru/prkontr/mf167.html" target="_blank"&gt;http://www.kaskod.ru/prkontr/mf167.html&lt;/a&gt;&lt;br /&gt;
The mathematical coprocessor on this board is external to the C167 microcontroller. Apparently it is Kaskod&amp;#39;s proprietary solution and there is no reason for Keil Software to include direct support of this coprocessor in its C166 package. You have to use both Kaskod&amp;#39;s and Infineon&amp;#39;s documentation to figure out how it all works.&lt;br /&gt;
So yes, you should use assembler to utilize the coprocessor and speed up calculations. I would suggest considering the &lt;b&gt;__asm&lt;/b&gt; keyword, which was introduced in the C166 toolset in v4.24. It should be better than &lt;b&gt;pragma asm/endasm&lt;/b&gt; in many respects.&lt;br /&gt;
&lt;br /&gt;
Best luck!&lt;br /&gt;
- mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/145824?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 08:14:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3c1e4ccc-2601-4f19-ae0a-53992cfe4266</guid><dc:creator>Alexey Gradovtsev</dc:creator><description>&lt;p&gt;To erik:&lt;br /&gt;
&lt;br /&gt;
You mean that there&amp;#39;s x86 processor in C16x controllers, and so what I have to do is find manual on x86 instructions? Could you kindly address me to where I can find it, please? Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/129752?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 08:08:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:667a28de-5aa8-488d-ace1-2b77875e8154</guid><dc:creator>Alexey Gradovtsev</dc:creator><description>&lt;p&gt;To Mike:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;C166 and x86 are very different architectures. Don&amp;#39;t assume that every processor has a single-instruction sine computation capability just because x86 does. Read the manual.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Oh I didn&amp;#39;t at once undestand what you mean. Of course there IS a single-instruction Sin function in MF167&amp;#39;s mathematical coprocessor. I just know it because I READ the manual on MF167 microcontroller.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/143869?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 07:50:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2841251c-fef9-400f-958e-83b8d22c44e5</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;i&gt;So the C16xs are, too.&lt;br /&gt;
Or I don&amp;#39;t understand your words...&lt;/i&gt;&lt;br /&gt;
Yes they are micro&lt;b&gt;controllers&lt;/b&gt; and for extensive math you need a micro&lt;b&gt;processor&lt;/b&gt;&lt;br /&gt;
Have a look at the x86 series&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/141236?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 06:51:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1ca97427-83f5-43ed-a98f-8b12b6f770c3</guid><dc:creator>Alexey Gradovtsev</dc:creator><description>&lt;p&gt;So the C16xs are, too.&lt;br /&gt;
Or I don&amp;#39;t understand your words...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/137661?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 06:45:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b2a4cc20-07c1-40ad-9460-3ed86b9669ba</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;If you need a math coprocessor you just chose the wrong chip to begin with.  The &amp;#39;51s are micro&lt;b&gt;controllers&lt;/b&gt; not micro&lt;b&gt;processors&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/129754?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 04:45:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:548d6cf1-4946-44a1-b4d7-fe68586913a1</guid><dc:creator>Alexey Gradovtsev</dc:creator><description>&lt;p&gt;So as far as I realise Keil compiler uses Taylor&amp;#39;s series (or smth. similar) to compute sine, cosine, etc? And that&amp;#39;s why these appear to be computed VERY slow. I can&amp;#39;t see any optimisation here while there&amp;#39;s coprocessor&amp;#39;s Sin, Cos functions which take 600 and 700 ns, resp. And there&amp;#39;s documented interface to coprocessor, but I&amp;#39;ve got some probs with it. So now the question is HOW to use coprocessor, not IF to use it ;)&lt;br /&gt;
&lt;br /&gt;
I don&amp;#39;t care about x86&amp;#39;s coprocessor capabilities. If I did, I wouldn&amp;#39;t take C16x at all. So if there are manuals/examples, I&amp;#39;d gratefully take them. That&amp;#39;s why I ask.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/121940?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 04:11:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1c900aa0-15fb-4c4e-8abe-8f5092686bd6</guid><dc:creator>Mik Kleshov</dc:creator><description>&lt;p&gt;Hi Alexey,&lt;br /&gt;
&lt;br /&gt;
Sine, cosine and other functions were written in assembly language by Keil Software. They use MUL, DIV, ADD, SUB etc. instructions to do the job. Those functions were well optimized (hopefully :-)). Of course you can try and write your own if you don&amp;#39;t like Keil&amp;#39;s ones.&lt;br /&gt;
C166 and x86 are very different architectures. Don&amp;#39;t assume that every processor has a single-instruction sine computation capability just because x86 does. Read the manual.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
- mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/110281?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2003 02:07:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d5fbcc84-26cb-4d06-b927-caa8f8388954</guid><dc:creator>Alexey Gradovtsev</dc:creator><description>&lt;p&gt;Well, what about Sin, Cos and other non-obvious functions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/95408?ContentTypeID=1</link><pubDate>Wed, 19 Mar 2003 08:44:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2f4e27e2-3593-4b60-8257-94236a1bccca</guid><dc:creator>Walt Conley</dc:creator><description>&lt;p&gt;AFAIK, this is all transparent to the programmer. Simply use the MUL and DIV instructions and let the processor do the rest.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/55137?ContentTypeID=1</link><pubDate>Wed, 19 Mar 2003 08:28:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:96f41b96-c821-4f52-9eb8-983ed8561538</guid><dc:creator>Alexey Gradovtsev</dc:creator><description>&lt;p&gt;Mathematical coprocessor of 16x controller.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Coprocessor</title><link>https://community.arm.com/thread/39973?ContentTypeID=1</link><pubDate>Wed, 19 Mar 2003 08:17:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c33a9045-e0f9-4dba-9e25-b7a9e968172c</guid><dc:creator>Walt Conley</dc:creator><description>&lt;p&gt;What do you mean by C167 coprocessor?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>