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

asin function on LPC1768

Hello

I am using LPC1768 for a motor control application. The motor will be
controlled with a series of pulses each of 2us wide.

I use a asin function to calculate the time between two pulses. (The
motor moves clock and anti-clock wise, hence a sin function is
considered)

when asin function is called, the code tends to break. ie it gets stuck
at hardware handler routine.

I believe the issue is with the use of asin function, although i am not
sure about it. I am using inbuilt asin in math.h

Can anyone kindly suggest me how to use a asin function on LPC1768. If
anyone can provide me a small code for how to use it on LPC1768 would be
of great help.

I have tried the code on rowley crossworks and on Keil. Both seem to
give the same error. But in simulator asin function is working fine.

Kindly suggest.

Regards

Prakash

Parents
  • HELLO

    We are also precalculating all the values and storing it in a table and then reading the calculated values from there.

    But the issue is that the code seems to work well with the simulator while it gives problem when i try to run using JTAG.

    This issue, i believe is because of asin function. When this function is called the system hangs in hardfault handler.

    When is just give asin(1) and try using debugger. The system moves to hardfault handler.

    I am also thinking of not using math.h and rather writing asin function. Is it possible to get the asin function definition. It would be very helpful if someone can provide the same. May be it would work

Reply
  • HELLO

    We are also precalculating all the values and storing it in a table and then reading the calculated values from there.

    But the issue is that the code seems to work well with the simulator while it gives problem when i try to run using JTAG.

    This issue, i believe is because of asin function. When this function is called the system hangs in hardfault handler.

    When is just give asin(1) and try using debugger. The system moves to hardfault handler.

    I am also thinking of not using math.h and rather writing asin function. Is it possible to get the asin function definition. It would be very helpful if someone can provide the same. May be it would work

Children