Other Parts Discussed in Thread: C2000WARE
Here're few questions from the customer may need your help:
1) Multiplication is required in the program, but the result of the multiplication is beyond the range of the original variable. How to convert it?
volatile uint16_t inv_VbusInst;
volatile uint16_t inv_VbusAvg;
Above are the two variables in the structure Inv_var.
inv_var.inv_VbusAvg =(uint16_t)( ( ( (uint32_t)inv_var.inv_VbusInst-10 ) *62 ) >>8);
The calculated statements are as follows:
When inv_var.inv_VbusInst=2000, the (inv_var.inv_VbusInst-10 )*6 result is greater than the maximum value of uint16_t data of 65536. Is the result of the multiplication automatically of the UINT16_t type, or is it left unchanged?
Because inv_var.inv_VbusInst was the UINT16_t type. How many instruction cycles does this take in the calculation?
3) During debug it's found the number of breakpoints cannot exceed two. Is it possible to set multiple breakpoints? Is there a runtime hint in debug? (the customer want to see when the code executes from one location to another)
4) What are the _IQmpy(a,B), IQsin(a), _IQ(float F) instruction cycles respectively for IQ?
Could you help check this case? Thanks.