---
tags: TI instaspin
---
# TI IQmath LIB介紹
By using the IQmath and Qmath libraries, it is possible to achieve execution speeds considerably faster and energy consumption considerably lower than equivalent code written using floating-point math.


>[TI IQ lib](https://www.ti.com/tool/MSP-IQMATHLIB#description)
長條圖➝CYCLES
折線圖➝Accuracy
在使用IQLIB\_32bits(藍綠色)的情況下,精確度較float高且運算效能也強,但會限制小數可表示的範圍。

>from [MSP430-IQmathLib-UsersGuide.pdf](https://t42073237.p.clickup-attachments.com/t42073237/e6e1b850-6049-4bb3-ac61-b05d286f3750/MSP430-IQmathLib-UsersGuide.pdf)
使用方式如下
方法一 可使各個模組依據情況選擇不同的IQ value
方法二 整個專案都使用相同的IQ value

>from [MSP430-IQmathLib-UsersGuide.pdf](https://t42073237.p.clickup-attachments.com/t42073237/e6e1b850-6049-4bb3-ac61-b05d286f3750/MSP430-IQmathLib-UsersGuide.pdf)
當各個運算模組選用不同的IQ value就會遇到需要相互轉換的情況,轉換方法如下。

>from [MSP430-IQmathLib-UsersGuide.pdf](https://t42073237.p.clickup-attachments.com/t42073237/e6e1b850-6049-4bb3-ac61-b05d286f3750/MSP430-IQmathLib-UsersGuide.pdf)
結論
當我們可以確定每個方塊輸入與輸出的數值範圍後,透過TI所提供的IQLIB,我們可以挑選合適的IQ值,對程式碼進行精確度和速度的優化,甚至在整個專案中使用多種不同的IQ值,更進一步優化程式。
## CCS SCOPE操作
在想要觀測的資料點選右鍵Graph

設定scope

根據該資料所設定之格式輸入相對應的Q_value
依照資料特性設定所想要的Sampling Rate

Enable Continuous Refresh
