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.
One additonal question: I need to convert the int-value to a long-value for the "connection" between two assembly- macros (PID-Controller and DACDRV_RAMP.asm). My problem is, that the output of the PID-Controller is a pointer to an integer and the input of DACDRV_RAMP is a pointer to a long value. Now I solve the problem this way:
CNTL_PID_Out1 = &Irefint; // pointer CNTL_PID_Out1 "connect" to Irefint (Both integer)
DACDRV_RAMP_In2=&Iref; // pointer DACDRV_RAMP_In2 "connect" to Iref (Both volatile long)
In a CPU-timer- based task with a period of 1ms I convert the int-value "Irefint" to the long-value "Iref" this way:
Iref=(long)(Irefint); // Typecast: Iref gets the value of Irefint, but in long ;)
Iref=Iref*256; // Scaling
The problem with this is, that the value of "Iref" is updated only every millisecond. It would be perfect to solve this problem that way, that "Iref" and "Irefint" are connected without time loss (by pointer). Is there any way to do this?
I am not sure how this would take 1ms to convert Irefint to long value "Iref" unless you change this as a part of big loop. If you are in a loop, you don't need to assign the address of Irefint and Iref to their corresponding variable each time in a loop. Keep these two statements outside the loop.
-Manoj