EmbDev.net

Forum: ARM programming with GCC/GNU tools asin function on LPC1768


Author: Prakash Rajolli (Company: Coinel Technology Solutions) (prakash)
Posted on:

Rate this post
0 useful
not useful
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

Author: Na sowas (Guest)
Posted on:

Rate this post
0 useful
not useful
Take that sample code: 
http://www.codecogs.com/reference/c/math.h/asin.php

> 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.
Do you also calculate asin() every 2us?
You know, that calculation of this function takes up time?

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.