This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Coprocessor

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.

Parents
  • To Mike:

    C166 and x86 are very different architectures. Don't assume that every processor has a single-instruction sine computation capability just because x86 does. Read the manual.

    Oh I didn't at once undestand what you mean. Of course there IS a single-instruction Sin function in MF167's mathematical coprocessor. I just know it because I READ the manual on MF167 microcontroller.

Reply
  • To Mike:

    C166 and x86 are very different architectures. Don't assume that every processor has a single-instruction sine computation capability just because x86 does. Read the manual.

    Oh I didn't at once undestand what you mean. Of course there IS a single-instruction Sin function in MF167's mathematical coprocessor. I just know it because I READ the manual on MF167 microcontroller.

Children
  • Sorry Alexey,
    This is clearly a case of misunderstanding. I can see that you mean this controller board:
    http://www.kaskod.ru/prkontr/mf167.html
    The mathematical coprocessor on this board is external to the C167 microcontroller. Apparently it is Kaskod'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's and Infineon's documentation to figure out how it all works.
    So yes, you should use assembler to utilize the coprocessor and speed up calculations. I would suggest considering the __asm keyword, which was introduced in the C166 toolset in v4.24. It should be better than pragma asm/endasm in many respects.

    Best luck!
    - mike

  • Of course there IS a single-instruction Sin function in MF167's mathematical coprocessor

    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?

    Thanks,
    Jon

  • Mike,

    Hm... Yes, I admit my guilt. I didn't say I use Cascod's MF167 controller. I just thought that it's a common approach to hardwire a coprocessor to 16x controllers and that they have common interface.

    Thanks a lot!

  • 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.

    Ask yourself just how accurate you need these function to be. Then consider alternatives such as look-up tables.

    You might consider using series other that the Taylor series, such as the Pade Approximation (see http://users.pandora.be/martin.brown/home/consult/logx.htm ). Google for more.