Other Parts Discussed in Thread: DAC128S085EVM
Tool/software: Code Composer Studio
Hello,
I am using the C2000 board to collect data from an ADC (MAX1202) and I am also using the DAC booster pack (DAC128S085EVM). I have no issues with sending or receiving data from these devices, however, when I try to use the data received from the ADC for some calculations, my program stops running.
Here is the contents of the project: https://db.tt/QHnD94zKVM
Code is pretty big, the main issue is:
1) spibphb = SpibRegs.SPIRXBUF;
while(SpibRegs.SPIFFRX.bit.RXFFST !=1) { }
spibphc = SpibRegs.SPIRXBUF;
2) I combine the data that I get from ADC: (spibphb<<5) | (spibphc>>3);
3) Assign a variable to it: v1x = (spibphb<<5) | (spibphc>>3);
4) Now If I try to use v1x for any arithmetic operation, my code stops. If I do not use v1x, then the code runs fine.
For example: If i use it in: beta = QMul(OneBySqrRtThree,v1x,15) - QMul(OneBySqrRtThree,v3,15);
Where #define QMul(x,y,n) (Int16)(((Int32)(x)*(Int32)(y))>>n), the code stops working.
I found out by putting the breakpoint that using v1x stops my code.
Please help me resolve this issue, I would greatly appreciate it. Thanks.