We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
No I have given valid number only in asin function ie from -1 to 1.
Its not feasible to generate the look table from PC, because in my project the look table will change in run time according to input given.
Change in what way? Most often, you can get away with a single lookup table that is just a multiplier from the real value and the real-time code can perform some simple integer arithmetic.