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.

Mixing _iq24 and int32 values - what happens?

If have some questions about using the IQmath library on the 2812 DSP:

 

1. What happens if somebody assigns an int32 value to an iq24 variable?

E.g.:

int32 my_int = 1234;

_iq24 my_constant = _IQ(3.5);

_iq_24 result;

_iq24 my_iq;

my_iq = my_int;

result = _IQmpy(my_iq, my_constant);

 

2. What happens when the IQdiv function is called with an int32 parameter instead of an _iq parameter? Or with 2 int32 parameters?

E.g.:

int32 my_int1 = 1234;

int32 my_int2 = 3456;

_iq24 my_constant = _IQ(3.5);

_iq_24 result;

result = _IQdiv(my_int1, my_constant);

result = _IQdiv(my_int1, my_int2);