This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377S: TMU => ARCTAN Input / Output Range

Part Number: TMS320F28377S


Hello there,

i´m invoking the TMU´s ARCTAN function and wanted to clarify my understanding of what the the input / output ranges reflect.I have read the document spruhs1a "TMS320C28x Extended Instruction Sets"
 and found on page 400 the example for the ARCTAN (see below).

Question 1: if i get the red marked lines right, the TMU´s input range applies to +/- 45degree on the unity circle?
For example for __atanpuf32(1.0) i get the 0.125 | if i do the multiplication from the red marked lines i get 0.7853 radians | A radian is around 57.296 degree. So 0.7853*57.293 is around 45°.
Question 2: Does that mean, i can only deal with arguments, that "end up" between +/-45 degree, or is there a workaround?

best regards!

Example ;; Calculate ATAN and generate Per Unit value and
;; convert to Radians:
MOV32 R0H,@AtanValue ; R0H = Atan Value
ATANPUF32 R1H,R0H ; R1H = ATANPU(R0H)
NOP ; pipeline delay
NOP ; pipeline delay
NOP ; pipeline delay
MPY2PIF32 R2H,R1H ; R2H = R1H * 2pi
; = Radian value
NOP ; pipeline delay
MOV @RadianValue,R2H ; Store result

  • You are correct that the ATANPUF32 instruction operates over a limited (output) range of +/- pi/4 radians. The find the arctan over a full circle, the instruction is used in conjunction with the QUADF32 instruction, which identifies the quadrant. Please see the description of the QUADF32 instruction in the TMU User's Guide (spruhs1a) for a description and example of how to use it to perform arctan over a full circle.

    Regards,

    Richard