CORDIC v2.0

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello all,

   

 

   

here's a follow-up to my previous post on the UDB based CORDIC. Here I present RFMS_CORDIC 2.0, which can operate in both Rotation mode (for calculating sine and cosine) and in Vectoring mode (for calculating hypotenuse and arctan2). I've also added support for PSoC 5LP, and provide two example projects demonstrating the operation of each modes on a PSoC 5LP device.

   

 

   

Note that the PSoC 3 version requires a clock that is at most 1/2 of the reference clock, and the PSoC 5LP version requires a clock that is at most 1/3 of the reference clock. Also the Vectoring mode demo project requires <math.h> library and ARM GCC 4.4 seems to have a problem with this. You can bypass this if you use ARM RVDS compiler.

   

 

   

Enjoy!

0 Likes
6 Replies
Anonymous
Not applicable

 Thanks 🙂

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

as we know from all the "007-Bond" episodes someone names "M" played a leading rule.

   

That's the case with the ARM-GCC toolchain as well: To use the math library you have to include an "m" into the "Additional Library" to be found

   

Project -> Build settings -> Linker

   

and all runs well!

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks Bob! Glad to know it's such an easy fix.

0 Likes
gica_284176
Level 2
Level 2
Welcome! 10 replies posted 5 replies posted

Dear I try the cordic implementation, but with a very dangerous result.

   

With a psoc3 kit, with only the cordic, all work fine.But when implemented the system in a different application ( with the same API) the calculus of the angle ( vectoring mode) is incorrect.The wrost things is that calculus change changing the clock supplied to cordic. And never correct .The clock system is 48 Mhz, the cordic from 4 Mhz to 24 Mhz.

   

Why ?.

   

Any body tested the cordic in field , out of demo behaviour ? The author do similar test ?.I dedicated a lot of work, but without a good result !

   

Best regards Giovanni

0 Likes
gica_284176
Level 2
Level 2
Welcome! 10 replies posted 5 replies posted

Dear All

   

I found the problem, and a do a workaround, but i desire a confirm from the rfms author.

   

In my application the calculated angle is correct if add at the value the INIT_ANGLE.Like that instead of a output values starting from 0° to 90°, the output  was -45° to + 45°

   

Why ?.

   

Best regards

   

Giovanni

0 Likes
gica_284176
Level 2
Level 2
Welcome! 10 replies posted 5 replies posted

Cordic at 8 bit

   

I use Cordic 2.0 for a angular encoder, in an industrial product  with satisfied result.

   

But for a large number of application, it's sufficient a resolution of 8 bit, with an improvement of speed.Now with psoc3 at with a cordic clock 24 Mhz take near 16 usec to convert.

   

At 8 bit (is a recursive algoritm) maybe near  8 microsec, and less resource.

   

A division of angle about 256*4 is sufficient in a lot industrial application.

   

For this reason, i try to   do a version with 8 bit, and after testing on real application , post on this forum  .

   

I give  a look on verilog file and udb path programming, but without correctly understand the how the cordic is implemented ( special udb).

   

If rfms give some info it's appreciate or collaborate with him , it's the best.

   

my reference is :

   

giovanni.casorerio@alice.it

0 Likes