DSP_MAC() function

General discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
torrescma
Posts: 2
Joined: 16 Oct 2019 14:55

DSP_MAC() function

#1 Post by torrescma » 20 Oct 2019 00:06

Hi all

I have tried to use DSP_MAC() to multiply and accumulate but the result of the operation is not correct, I tried a simple math

a = a + b*c

where a is accumulator, b and c operands. But the results is double the correct answer

Code: Select all

A = dsp_clr();
A = dsp_mac(A,1,1,0,0,0,0,0,0,0);
The correct answer is a = 0 + 1*1 = 1, but it returns 2. In every operation it gives double, like adding twice.

Any idea?

Thanks

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: DSP_MAC() function

#2 Post by stefan.filipovic » 22 Nov 2019 12:04

Hi,

I believe that you have been answered here:
viewtopic.php?f=101&t=75471

Kind regards,
Stefan Filipović

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 General”